main: Check g_setenv() return value
From Coverity: iio-sensor-proxy-3.3/src/iio-sensor-proxy.c:964: check_return: Calling "g_setenv("G_MESSAGES_DEBUG", "all", 1)" without checking return value. This library function may fail and return an error code.
This commit is contained in:
@@ -1001,7 +1001,10 @@ int main (int argc, char **argv)
|
||||
}
|
||||
|
||||
if (verbose) {
|
||||
g_setenv ("G_MESSAGES_DEBUG", "all", TRUE);
|
||||
if (!g_setenv ("G_MESSAGES_DEBUG", "all", TRUE)) {
|
||||
g_warning ("Failed to enable debug");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
g_debug ("Starting iio-sensor-proxy version "VERSION);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user