about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-02-08 03:02:18 +0000
committerEric Wong <normalperson@yhbt.net>2013-02-08 03:02:18 +0000
commit223adf17682765f9e72d3436348700085d823a6e (patch)
tree8291986e487516d04bd17f6001c8a74a0954cfce
parentd8ac1b937647b86342135a91abe933a3f8812909 (diff)
downloadcmogstored-223adf17682765f9e72d3436348700085d823a6e.tar.gz
Having a NULL at the beginning of the list caused
iteration in the destructor to stop, allowing valgrind
to detect a memory leak.
-rw-r--r--upgrade.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/upgrade.c b/upgrade.c
index 8d96060..6935b53 100644
--- a/upgrade.c
+++ b/upgrade.c
@@ -49,7 +49,7 @@ void mog_upgrade_prepare(int argc, char *argv[], char *envp[])
 
         /* duplicate envp */
         e = start.envp;
-        *e++ = NULL; /* save this slot for CMOGSTORED_FD */
+        *e++ = xstrdup(FD_PFX); /* placeholder */
         for (; *envp; envp++) {
                 if (strncmp(*envp, FD_PFX, strlen(FD_PFX)))
                         *e++ = xstrdup(*envp);