From: Andrea Claudi Date: Sat, 1 May 2021 16:39:23 +0000 (+0200) Subject: dcb: fix memory leak X-Git-Tag: v5.14.0~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d212aae55b81d894130747f945563274975d9ce;p=thirdparty%2Fiproute2.git dcb: fix memory leak main() dinamically allocates dcb, but when dcb_help() is called it returns without freeing it. Fix this using a goto, as it is already done in the same function. Fixes: 67033d1c1c8a ("Add skeleton of a new tool, dcb") Signed-off-by: Andrea Claudi Reviewed-by: Petr Machata Signed-off-by: David Ahern --- diff --git a/dcb/dcb.c b/dcb/dcb.c index 64a9ef02d..696f00e4e 100644 --- a/dcb/dcb.c +++ b/dcb/dcb.c @@ -571,7 +571,8 @@ int main(int argc, char **argv) break; case 'h': dcb_help(); - return 0; + ret = EXIT_SUCCESS; + goto dcb_free; default: fprintf(stderr, "Unknown option.\n"); dcb_help();