From: Ralph Corderoy Date: Mon, 31 Oct 2016 18:36:19 +0000 (+0000) Subject: ali: Fix a memory leak spotted by valgrind. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/6f00b318211388fcc346023dd37c80e8ea7e1703?ds=sidebyside ali: Fix a memory leak spotted by valgrind. --- diff --git a/uip/ali.c b/uip/ali.c index 4d73afa7..1f725da7 100644 --- a/uip/ali.c +++ b/uip/ali.c @@ -143,9 +143,13 @@ main (int argc, char **argv) } else { /* print them all */ for (ak = akahead; ak; ak = ak->ak_next) { + char *res; + printf ("%s: ", ak->ak_name); pos += strlen (ak->ak_name) + 1; - print_aka (akresult (ak), list, pos); + res = akresult(ak); + print_aka(res, list, pos); + free(res); } } }