]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ip: fix memory leak in do_show()
authorMinhong He <heminhong@kylinos.cn>
Mon, 25 Nov 2024 06:08:48 +0000 (14:08 +0800)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 25 Nov 2024 17:02:49 +0000 (09:02 -0800)
Free the 'answer' obtained from 'rtnl_talk()'.

Fixes: 6887a0656dad ("ip: netconf: fix overzealous error checking")
Signed-off-by: Minhong He <heminhong@kylinos.cn>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
ip/ipnetconf.c

index cf27e7e30a5af41cea68b4d2ec90810d9325951a..020eff786d0b82f3033a71c2f4fc3d5b1af5f099 100644 (file)
@@ -197,6 +197,7 @@ static int do_show(int argc, char **argv)
                        exit(2);
 
                print_netconf2(answer, stdout);
+               free(answer);
        } else {
                rth.flags = RTNL_HANDLE_F_SUPPRESS_NLERR;
 dump: