From 7ec917eed28fa973438f0d1d8d3e3a45649f6875 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Fri, 17 Apr 2015 10:06:21 +0100 Subject: [PATCH] ensure memory is freed on error path in gtk viewdata --- gtk/viewdata.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gtk/viewdata.c b/gtk/viewdata.c index 37e5d1380..bde87a70a 100644 --- a/gtk/viewdata.c +++ b/gtk/viewdata.c @@ -489,7 +489,11 @@ window_init_fname(const char *title, fclose(f); + /* window init takes ownership of the ndata if there is no error */ ret = window_init(title, leafname, ndata, ndata_len); + if (ret != NSERROR_OK) { + free(ndata); + } return ret; }