From: Baptiste Daroussin Date: Wed, 12 Apr 2023 09:38:55 +0000 (+0200) Subject: unsubscription: plug memory leaks X-Git-Tag: RELEASE_1_4_0b1~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d48455781a278854645b8937d900ca4d7818533f;p=thirdparty%2Fmlmmj.git unsubscription: plug memory leaks --- diff --git a/src/subscriberfuncs.c b/src/subscriberfuncs.c index 5708f35a..7dbd5853 100644 --- a/src/subscriberfuncs.c +++ b/src/subscriberfuncs.c @@ -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)