]> git.mdlowis.com Git - proto/labwc.git/commitdiff
session: abort process_line early if line contains no key
authorAndrew J. Hesford <ajh@sideband.org>
Wed, 13 Mar 2024 10:14:55 +0000 (06:14 -0400)
committerConsolatis <35009135+Consolatis@users.noreply.github.com>
Wed, 13 Mar 2024 10:47:11 +0000 (11:47 +0100)
src/config/session.c

index e657a9abcd128c7efa205fdc24cb5ceebe56f6da..f97dd813c23305068e9b7271adeb7b39f19a6f0a 100644 (file)
@@ -45,18 +45,16 @@ process_line(char *line)
        }
        *p = '\0';
        key = string_strip(line);
+       if (string_null_or_empty(key)) {
+               return;
+       }
 
        struct buf value;
        buf_init(&value);
        buf_add(&value, string_strip(++p));
        buf_expand_shell_variables(&value);
        buf_expand_tilde(&value);
-       if (string_null_or_empty(key)) {
-               goto error;
-       }
-
        setenv(key, value.buf, 1);
-error:
        free(value.buf);
 }