[PATCH][weston] ivi_layout_surface_add_notification: Fix potential leak of memory pointed to by 'notification'

Lucas Tanure tanure at linux.com
Sat Sep 19 14:24:58 PDT 2015


Signed-off-by: Lucas Tanure <tanure at linux.com>
---
 ivi-shell/ivi-layout.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
index 24bd8dd..061f156 100644
--- a/ivi-shell/ivi-layout.c
+++ b/ivi-shell/ivi-layout.c
@@ -1532,6 +1532,7 @@ ivi_layout_surface_add_notification(struct ivi_layout_surface *ivisurf,
 	prop_callback = malloc(sizeof *prop_callback);
 	if (prop_callback == NULL) {
 		weston_log("fails to allocate memory\n");
+		free(notification);
 		return IVI_FAILED;
 	}
 
-- 
2.5.3



More information about the wayland-devel mailing list