From: Michal Privoznik Date: Tue, 7 Jan 2014 14:42:44 +0000 (+0100) Subject: lxc_controller: Don't leak @name X-Git-Tag: v1.2.1-rc1~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e6891106d4aa558671fc92ea17347454a1afdd9;p=thirdparty%2Flibvirt.git lxc_controller: Don't leak @name The @name variable is VIR_STRDUP()-ed into, but never freed. In fact, there's no need to duplicate a command line argument since all places where @name is used expect const char. Signed-off-by: Michal Privoznik --- diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index c013147f7a..1b43bd2638 100644 --- a/src/lxc/lxc_controller.c +++ b/src/lxc/lxc_controller.c @@ -2249,7 +2249,7 @@ int main(int argc, char *argv[]) { pid_t pid; int rc = -1; - char *name = NULL; + const char *name = NULL; size_t nveths = 0; char **veths = NULL; int handshakeFd = -1; @@ -2300,8 +2300,7 @@ int main(int argc, char *argv[]) break; case 'n': - if (VIR_STRDUP(name, optarg) < 0) - goto cleanup; + name = optarg; break; case 'v':