diff options
author | Jean Delvare <khali@linux-fr.org> | 2009-02-20 10:56:52 +0000 |
---|---|---|
committer | Jean Delvare <khali@linux-fr.org> | 2009-02-20 10:56:52 +0000 |
commit | c1a066a3075f4f93e40dd53d2c656c2c7ea1d1a0 (patch) | |
tree | 51ca36ba7d4469c1fd27c6f4f9b855ba7d602d6d /lib/init.c | |
parent | 0bc948ca6a9ec979fca46604b2649540652bedba (diff) | |
download | lm-sensors-git-c1a066a3075f4f93e40dd53d2c656c2c7ea1d1a0.tar.gz |
If str(n)dup fails, there is no more memory left. We should exit with
"Out of memory". Patch from Andre Prendel.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5661 7894878c-1315-0410-8ee3-d5d059ff63e0
Diffstat (limited to 'lib/init.c')
-rw-r--r-- | lib/init.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -53,6 +53,9 @@ static int sensors_parse(void) locale = setlocale(LC_ALL, NULL); if (locale) { locale = strdup(locale); + if (!locale) + sensors_fatal_error(__func__, "Out of memory"); + setlocale(LC_ALL, "C"); } |