From 223adf17682765f9e72d3436348700085d823a6e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 8 Feb 2013 03:02:18 +0000 Subject: upgrade: fix env placeholder for valgrind Having a NULL at the beginning of the list caused iteration in the destructor to stop, allowing valgrind to detect a memory leak. --- upgrade.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- cgit v1.2.3-24-ge0c7