summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2014-08-18 15:03:15 +0100
committerVincent Sanders <vince@kyllikki.org>2014-08-18 15:03:15 +0100
commit881b4d447dd7b33a382bb7945d2aa4e055c68384 (patch)
treedf44ae671e025eb7f45ce9140fba6e78e9009baf
parent035d14df0e854b0f055fb4922d6fa533dc0ea71d (diff)
downloadnetsurf-881b4d447dd7b33a382bb7945d2aa4e055c68384.tar.gz
netsurf-881b4d447dd7b33a382bb7945d2aa4e055c68384.tar.bz2
fix leaking of title text (coverity 1229480)
-rw-r--r--gtk/viewsource.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/gtk/viewsource.c b/gtk/viewsource.c
index cbcbad712..9c28f6927 100644
--- a/gtk/viewsource.c
+++ b/gtk/viewsource.c
@@ -16,14 +16,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdlib.h>
-#include <string.h>
-#include <stdbool.h>
#include <gtk/gtk.h>
-#include "utils/nsurl.h"
-#include "utils/url.h"
#include "utils/utils.h"
+#include "utils/url.h"
#include "utils/utf8.h"
#include "utils/messages.h"
#include "desktop/browser.h"
@@ -71,11 +67,10 @@ void nsgtk_viewsource(GtkWindow *parent, struct browser_window *bw)
source_size,
&ndata,
&ndata_len);
- if (ret != NSERROR_OK) {
- free(filename);
- return;
+ if (ret == NSERROR_OK) {
+ ret = nsgtk_viewdata(title, filename, ndata, ndata_len);
}
- ret = nsgtk_viewdata(title, filename, ndata, ndata_len);
free(filename);
+ free(title);
}