diff options
author | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2011-11-01 10:42:36 -0200 |
---|---|---|
committer | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2011-11-24 17:47:37 -0200 |
commit | d41987d77c903e00cca7bcf3e04ed07151e3bb4d (patch) | |
tree | c0d7e190e5ffa66768cde83aa3221d555e3f1675 | |
parent | d5c7338b3eaea55177ade6fcba71a47ccd5547f5 (diff) |
parser: free val.str after xf86getBoolValue
After we convert the value to a boolean, we discard the string.
This is just one example:
3 bytes in 1 blocks are definitely lost in loss record 5 of 657
at 0x4C2779D: malloc (vgpreload_memcheck-amd64-linux.so)
by 0x4D744D: xf86getToken (scan.c:400)
by 0x4D75F1: xf86getSubToken (scan.c:462)
by 0x4DB3E0: xf86parseInputClassSection (InputClass.c:189)
by 0x4D664C: xf86readConfigFile (read.c:184)
by 0x490556: xf86HandleConfigFile (xf86Config.c:2360)
by 0x49AA77: InitOutput (xf86Init.c:365)
by 0x425A7A: main (main.c:204)
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
-rw-r--r-- | hw/xfree86/parser/InputClass.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/hw/xfree86/parser/InputClass.c b/hw/xfree86/parser/InputClass.c index 3f801700e..11289959f 100644 --- a/hw/xfree86/parser/InputClass.c +++ b/hw/xfree86/parser/InputClass.c @@ -182,6 +182,7 @@ xf86parseInputClassSection(void) Error(QUOTE_MSG, "MatchIsKeyboard"); ptr->is_keyboard.set = xf86getBoolValue(&ptr->is_keyboard.val, val.str); + free(val.str); if (!ptr->is_keyboard.set) Error(BOOL_MSG, "MatchIsKeyboard"); break; @@ -190,6 +191,7 @@ xf86parseInputClassSection(void) Error(QUOTE_MSG, "MatchIsPointer"); ptr->is_pointer.set = xf86getBoolValue(&ptr->is_pointer.val, val.str); + free(val.str); if (!ptr->is_pointer.set) Error(BOOL_MSG, "MatchIsPointer"); break; @@ -198,6 +200,7 @@ xf86parseInputClassSection(void) Error(QUOTE_MSG, "MatchIsJoystick"); ptr->is_joystick.set = xf86getBoolValue(&ptr->is_joystick.val, val.str); + free(val.str); if (!ptr->is_joystick.set) Error(BOOL_MSG, "MatchIsJoystick"); break; @@ -206,6 +209,7 @@ xf86parseInputClassSection(void) Error(QUOTE_MSG, "MatchIsTablet"); ptr->is_tablet.set = xf86getBoolValue(&ptr->is_tablet.val, val.str); + free(val.str); if (!ptr->is_tablet.set) Error(BOOL_MSG, "MatchIsTablet"); break; @@ -214,6 +218,7 @@ xf86parseInputClassSection(void) Error(QUOTE_MSG, "MatchIsTouchpad"); ptr->is_touchpad.set = xf86getBoolValue(&ptr->is_touchpad.val, val.str); + free(val.str); if (!ptr->is_touchpad.set) Error(BOOL_MSG, "MatchIsTouchpad"); break; @@ -222,6 +227,7 @@ xf86parseInputClassSection(void) Error(QUOTE_MSG, "MatchIsTouchscreen"); ptr->is_touchscreen.set = xf86getBoolValue(&ptr->is_touchscreen.val, val.str); + free(val.str); if (!ptr->is_touchscreen.set) Error(BOOL_MSG, "MatchIsTouchscreen"); break; |