[PATCH 4/6] image: Free allocated memory on error path

Rob Bradford robert.bradford at intel.com
Thu Jan 10 11:48:55 PST 2013


From: Rob Bradford <rob at linux.intel.com>

---
 clients/image.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/clients/image.c b/clients/image.c
index 6a2bda3..e25a665 100644
--- a/clients/image.c
+++ b/clients/image.c
@@ -373,6 +373,7 @@ image_create(struct display *display, const char *filename,
 
 	if (!image->image) {
 		fprintf(stderr, "could not find the image %s!\n", b);
+		free(image);
 		return NULL;
 	}
 
-- 
1.7.11.7



More information about the wayland-devel mailing list