summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/util/namespaces.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/perf/util/namespaces.c b/tools/perf/util/namespaces.c
index 5be021701f34..cf8bd123cf73 100644
--- a/tools/perf/util/namespaces.c
+++ b/tools/perf/util/namespaces.c
@@ -139,6 +139,9 @@ struct nsinfo *nsinfo__copy(struct nsinfo *nsi)
139{ 139{
140 struct nsinfo *nnsi; 140 struct nsinfo *nnsi;
141 141
142 if (nsi == NULL)
143 return NULL;
144
142 nnsi = calloc(1, sizeof(*nnsi)); 145 nnsi = calloc(1, sizeof(*nnsi));
143 if (nnsi != NULL) { 146 if (nnsi != NULL) {
144 nnsi->pid = nsi->pid; 147 nnsi->pid = nsi->pid;