提交 0e689110 编写于 作者: M Michal Privoznik

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: NMichal Privoznik <mprivozn@redhat.com>
上级 3b564259
...@@ -2249,7 +2249,7 @@ int main(int argc, char *argv[]) ...@@ -2249,7 +2249,7 @@ int main(int argc, char *argv[])
{ {
pid_t pid; pid_t pid;
int rc = -1; int rc = -1;
char *name = NULL; const char *name = NULL;
size_t nveths = 0; size_t nveths = 0;
char **veths = NULL; char **veths = NULL;
int handshakeFd = -1; int handshakeFd = -1;
...@@ -2300,8 +2300,7 @@ int main(int argc, char *argv[]) ...@@ -2300,8 +2300,7 @@ int main(int argc, char *argv[])
break; break;
case 'n': case 'n':
if (VIR_STRDUP(name, optarg) < 0) name = optarg;
goto cleanup;
break; break;
case 'v': case 'v':
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册