buildfile: don't forget to free temporary string bpath
[surf.git] / surf.c
diff --git a/surf.c b/surf.c
index ff2496d..d36053e 100644 (file)
--- a/surf.c
+++ b/surf.c
@@ -273,6 +273,7 @@ buildfile(const char *path)
        g_free(dname);
 
        fpath = g_build_filename(bpath, bname, NULL);
+       g_free(bpath);
        g_free(bname);
 
        if (!(f = fopen(fpath, "a")))
@@ -695,10 +696,12 @@ initdownload(WebKitWebView *view, WebKitDownload *o, Client *c)
 void
 inspector(Client *c, const Arg *arg)
 {
-       if (c->isinspecting)
-               webkit_web_inspector_close(c->inspector);
-       else
-               webkit_web_inspector_show(c->inspector);
+       if (enableinspector) {
+               if (c->isinspecting)
+                       webkit_web_inspector_close(c->inspector);
+               else
+                       webkit_web_inspector_show(c->inspector);
+       }
 }
 
 WebKitWebView *
@@ -801,7 +804,7 @@ loadstatuschange(WebKitWebView *view, GParamSpec *pspec, Client *c)
                }
                setatom(c, AtomUri, uri);
 
-               if (enablestyles)
+               if (enablestyle)
                        setstyle(c, getstyle(uri));
                break;
        case WEBKIT_LOAD_FINISHED:
@@ -1019,7 +1022,7 @@ newclient(void)
                     "default-font-size", defaultfontsize, NULL);
        g_object_set(G_OBJECT(settings),
                     "resizable-text-areas", 1, NULL);
-       if (enablestyles)
+       if (enablestyle)
                setstyle(c, getstyle("about:blank"));
 
        /*
@@ -1532,8 +1535,8 @@ togglescrollbars(Client *c, const Arg *arg)
 void
 togglestyle(Client *c, const Arg *arg)
 {
-       enablestyles = !enablestyles;
-       setstyle(c, enablestyles ? getstyle(geturi(c)) : "");
+       enablestyle = !enablestyle;
+       setstyle(c, enablestyle ? getstyle(geturi(c)) : "");
 
        updatetitle(c);
 }
@@ -1564,7 +1567,7 @@ gettogglestat(Client *c)
        g_object_get(G_OBJECT(settings), "enable-plugins", &value, NULL);
        togglestat[p++] = value? 'V': 'v';
 
-       togglestat[p++] = enablestyles ? 'M': 'm';
+       togglestat[p++] = enablestyle ? 'M': 'm';
 
        togglestat[p] = '\0';
 }
@@ -1707,10 +1710,10 @@ main(int argc, char *argv[])
                kioskmode = 1;
                break;
        case 'm':
-               enablestyles = 0;
+               enablestyle = 0;
                break;
        case 'M':
-               enablestyles = 1;
+               enablestyle = 1;
                break;
        case 'n':
                enableinspector = 0;