[PATCH 1/6] screenshooter: Free allocated memory where missing from some return paths

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


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

---
 src/screenshooter.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/screenshooter.c b/src/screenshooter.c
index 4f6599f..c8da376 100644
--- a/src/screenshooter.c
+++ b/src/screenshooter.c
@@ -417,6 +417,7 @@ weston_recorder_create(struct weston_output *output, const char *filename)
 		break;
 	default:
 		weston_log("unknown recorder format\n");
+		free(recorder);
 		return;
 	}
 
@@ -425,6 +426,7 @@ weston_recorder_create(struct weston_output *output, const char *filename)
 
 	if (recorder->fd < 0) {
 		weston_log("problem opening output file %s: %m\n", filename);
+		free(recorder);
 		return;
 	}
 
-- 
1.7.11.7



More information about the wayland-devel mailing list