Removing a memory leak when u wasn't freed.

This commit is contained in:
Christoph Lohmann 2014-02-06 06:47:22 +01:00
parent 361da0b3c4
commit 127dc366ef
1 changed files with 3 additions and 2 deletions

5
surf.c
View File

@ -656,7 +656,7 @@ loadstatuschange(WebKitWebView *view, GParamSpec *pspec, Client *c) {
static void static void
loaduri(Client *c, const Arg *arg) { loaduri(Client *c, const Arg *arg) {
char *u, *rp; char *u = NULL, *rp;
const char *uri = (char *)arg->v; const char *uri = (char *)arg->v;
Arg a = { .b = FALSE }; Arg a = { .b = FALSE };
struct stat st; struct stat st;
@ -683,9 +683,10 @@ loaduri(Client *c, const Arg *arg) {
webkit_web_view_load_uri(c->view, u); webkit_web_view_load_uri(c->view, u);
c->progress = 0; c->progress = 0;
c->title = copystr(&c->title, u); c->title = copystr(&c->title, u);
g_free(u);
updatetitle(c); updatetitle(c);
} }
if(u != NULL)
g_free(u);
} }
static void static void