lls_parse_arg(): Don't free static memory.
[lopsub.git] / lopsub.c
index 55ea6ac..44abc93 100644 (file)
--- a/lopsub.c
+++ b/lopsub.c
@@ -651,7 +651,7 @@ static int lls_parse_arg(struct lls_arg *la, const struct lls_option *opts,
        }
        switch (opt->arg_type) {
        case LLS_STRING:
-               if (lor->given > 0 && !multiple)
+               if (!opt->values && lor->given > 0 && !multiple)
                        free(lor->value[idx].string_val);
                if (opt->values) {
                        ret = check_enum_arg(la->arg, opt, errctx);