From 9d14efec4cdcd84863324c798b6a63a1f013c5dc Mon Sep 17 00:00:00 2001 From: Antonio Murdaca Date: Fri, 13 May 2016 12:40:57 +0200 Subject: [PATCH] libcontainer: nsenter: nsexec.c: fix warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix the following warnings when building runc with gcc 6+: Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/nsenter/nsexec.c: In function ‘nsexec’: Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/nsenter/nsexec.c:322:6: warning: ‘__s’ may be used uninitialized in this function [-Wmaybe-uninitialized] pr_perror("Failed to open %s", ns); Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/nsenter/nsexec.c:273:30: note: ‘__s’ was declared here static struct nsenter_config process_nl_attributes(int pipenum, char *data, int data_size) ^~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Antonio Murdaca --- libcontainer/nsenter/nsexec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcontainer/nsenter/nsexec.c b/libcontainer/nsenter/nsexec.c index 40a8f89c0..cb7a66299 100644 --- a/libcontainer/nsenter/nsexec.c +++ b/libcontainer/nsenter/nsexec.c @@ -302,7 +302,7 @@ static struct nsenter_config process_nl_attributes(int pipenum, char *data, int int fds[nslen]; char *nslist[nslen]; char *ns; - char *saveptr; + char *saveptr = NULL; for (i = 0; i < nslen; i++) { char *str = NULL;