]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
unsubscription: plug memory leaks
authorBaptiste Daroussin <bapt@FreeBSD.org>
Wed, 12 Apr 2023 09:38:55 +0000 (11:38 +0200)
committerBaptiste Daroussin <bapt@FreeBSD.org>
Wed, 12 Apr 2023 09:38:55 +0000 (11:38 +0200)
src/subscriberfuncs.c

index 5708f35a927d38a36f9c2c1549ab3235ed0af7af..7dbd5853006c8c86dd1028920c6f8607156c442b 100644 (file)
@@ -371,6 +371,7 @@ do_unsubscribe(struct ml *ml, const char *addr, enum subtype typesub,
                if (fd == -1) {
                        log_error(LOG_ARGS, "Could not opendir(%s/%s)", ml->dir,
                            subdir);
+                       free(address);
                        return (false);
                }
                subscribed = is_subbed_in(fd, subdir, address);
@@ -380,6 +381,7 @@ do_unsubscribe(struct ml *ml, const char *addr, enum subtype typesub,
        if (!subscribed) {
                if (inform_not_subscribed)
                        generate_subscription(ml, address, typesub, false);
+               free(address);
                return (true);
        }
        if (confirm_unsubscription)