tRemoving a memory leak when u wasn't freed. - surf - customized build of surf, the suckless webkit browser
 (HTM) git clone git://src.adamsgaard.dk/surf
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 127dc366efeda9afc6086be67b60979af1d71205
 (DIR) parent 361da0b3c4bc9f86d4653b026ad16ec4ed5c02c2
 (HTM) Author: Christoph Lohmann <20h@r-36.net>
       Date:   Thu,  6 Feb 2014 06:47:22 +0100
       
       Removing a memory leak when u wasn't freed.
       
       Diffstat:
         M surf.c                              |       5 +++--
       
       1 file changed, 3 insertions(+), 2 deletions(-)
       ---
 (DIR) diff --git a/surf.c b/surf.c
       t@@ -656,7 +656,7 @@ loadstatuschange(WebKitWebView *view, GParamSpec *pspec, Client *c) {
        
        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;
       t@@ -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);
       -                g_free(u);
                        updatetitle(c);
                }
       +        if(u != NULL)
       +                g_free(u);
        }
        
        static void