]> the.earth.li Git - onak.git/blobdiff - maxpath.c
Fix issues found by llvm scan-build static analysis
[onak.git] / maxpath.c
index fbd5a177deed76eb30139ebd8a5d85cd8abd7adf..0932df31669b98034affda15fa0eb9ba5fc55f44 100644 (file)
--- a/maxpath.c
+++ b/maxpath.c
@@ -91,12 +91,16 @@ int main(int argc, char *argv[])
        while ((optchar = getopt(argc, argv, "c:")) != -1 ) {
                switch (optchar) {
                case 'c':
+                       if (configfile != NULL) {
+                               free(configfile);
+                       }
                        configfile = strdup(optarg);
                        break;
                }
        }
 
        readconfig(configfile);
+       free(configfile);
        initlogthing("maxpath", config.logfile);
        dbctx = config.dbinit(true);
        if (dbctx != NULL) {