diff options
author | Bastien Nocera <hadess@hadess.net> | 2015-05-26 11:44:41 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2015-05-26 12:03:57 +0200 |
commit | 8ec4957be774d92b8bdeb1b618738844873cf354 (patch) | |
tree | 3b1397a8206b1e0a1e8e637865726b2c40d0d0a7 | |
parent | b7f6fe30bef75513360160fb6eef2290d6403129 (diff) | |
download | gnome-settings-daemon-8ec4957be774d92b8bdeb1b618738844873cf354.tar.gz |
wacom: Fix freeing buffer in OLED helper
We can't free "", buffer needs to be set by the command-line options,
but we never check that it got set.
From coverity:
gnome-settings-daemon-3.14.4/plugins/wacom/gsd-wacom-oled-helper.c:415: incorrect_free: "g_free" frees incorrect pointer "buffer".
https://bugzilla.gnome.org/show_bug.cgi?id=749882
-rw-r--r-- | plugins/wacom/gsd-wacom-oled-helper.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/wacom/gsd-wacom-oled-helper.c b/plugins/wacom/gsd-wacom-oled-helper.c index 511a1205..86f2891a 100644 --- a/plugins/wacom/gsd-wacom-oled-helper.c +++ b/plugins/wacom/gsd-wacom-oled-helper.c @@ -339,7 +339,7 @@ int main (int argc, char **argv) GsdWacomOledType type; char *path = NULL; - char *buffer = ""; + char *buffer = NULL; int button_num = -1; const GOptionEntry options[] = { @@ -363,7 +363,8 @@ int main (int argc, char **argv) g_option_context_parse (context, &argc, &argv, NULL); if (path == NULL || - button_num < 0) { + button_num < 0 || + buffer == NULL) { char *txt; txt = g_option_context_get_help (context, FALSE, NULL); |