pinosaur
/
surf.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Removing a memory leak when u wasn't freed.
[surf.git]
/
surf.c
diff --git
a/surf.c
b/surf.c
index
c598404
..
1ec4c62
100644
(file)
--- a/
surf.c
+++ b/
surf.c
@@
-656,7
+656,7
@@
loadstatuschange(WebKitWebView *view, GParamSpec *pspec, Client *c) {
static void
loaduri(Client *c, const Arg *arg) {
static void
loaduri(Client *c, const Arg *arg) {
- char *u, *rp;
+ char *u
= NULL
, *rp;
const char *uri = (char *)arg->v;
Arg a = { .b = FALSE };
struct stat st;
const char *uri = (char *)arg->v;
Arg a = { .b = FALSE };
struct stat st;
@@
-683,9
+683,10
@@
loaduri(Client *c, const Arg *arg) {
webkit_web_view_load_uri(c->view, u);
c->progress = 0;
c->title = copystr(&c->title, u);
webkit_web_view_load_uri(c->view, u);
c->progress = 0;
c->title = copystr(&c->title, u);
- g_free(u);
updatetitle(c);
}
updatetitle(c);
}
+ if(u != NULL)
+ g_free(u);
}
static void
}
static void