ensure memory is freed on error path in gtk viewdata

This commit is contained in:
Vincent Sanders 2015-04-17 10:06:21 +01:00
parent 82c1ed9f4a
commit 7ec917eed2

View File

@ -489,7 +489,11 @@ window_init_fname(const char *title,
fclose(f); fclose(f);
/* window init takes ownership of the ndata if there is no error */
ret = window_init(title, leafname, ndata, ndata_len); ret = window_init(title, leafname, ndata, ndata_len);
if (ret != NSERROR_OK) {
free(ndata);
}
return ret; return ret;
} }