]> git.mdlowis.com Git - proto/labwc.git/commitdiff
session.c: fix memory leak
authorJohan Malm <jgm323@gmail.com>
Wed, 28 Oct 2020 20:44:35 +0000 (20:44 +0000)
committerJohan Malm <jgm323@gmail.com>
Wed, 28 Oct 2020 20:44:35 +0000 (20:44 +0000)
Reported-by: Jan Beich (@jbeich)
src/config/session.c

index b70a18b607dc24126e0e66350f1b8f2704faf5ae..b046bece61c42fea3d8c2cb0c6b4593f26146255 100644 (file)
@@ -99,14 +99,15 @@ session_autostart_init(void)
        }
        if (!isfile(autostart)) {
                warn("no autostart file");
-               return;
+               goto out;
        }
-       info("sh autostart file (%s)", autostart);
+       info("run autostart file (%s)", autostart);
        int len = strlen(autostart) + 4;
        char *cmd = calloc(len, 1);
        strcat(cmd, "sh ");
        strcat(cmd, autostart);
        spawn_async_no_shell(cmd);
        free(cmd);
+out:
        free((void*)autostart);
 }