From 896c18045aafb9c677d8d41b4876c47db2b4d5ce Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Fri, 9 Oct 2015 12:32:37 +0100 Subject: [PATCH] Eeze sensor udev: Fix memory leak and possible crash. Due to a misplaced semicolon, EINA_LIST_FREE was doing nothing and only the last part was freed if there was one, and probably a crash if there wasn't. This shows again that having statements without {} is dangerous. We need to force {} and add a lint rule, or at the very least, add a rule to put the ; in a new line (like clang warns about by default anyway). (Same as issue found in previous commit) @fix --- src/modules/eeze/sensor/udev/udev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/eeze/sensor/udev/udev.c b/src/modules/eeze/sensor/udev/udev.c index 3e7e6b3e17..cf52cd349f 100644 --- a/src/modules/eeze/sensor/udev/udev.c +++ b/src/modules/eeze/sensor/udev/udev.c @@ -48,7 +48,7 @@ udev_shutdown(void) { char *data; - EINA_LIST_FREE(devices, data); + EINA_LIST_FREE(devices, data) free(data); return EINA_TRUE;