]> granicus.if.org Git - postgresql/commitdiff
Fix resource leak in initdb -X option
authorStephen Frost <sfrost@snowman.net>
Sun, 14 Jul 2013 21:44:29 +0000 (17:44 -0400)
committerStephen Frost <sfrost@snowman.net>
Sun, 14 Jul 2013 21:44:29 +0000 (17:44 -0400)
When creating the symlink for the xlog directory, free the string
which stores the link location.  Not really an issue but it doesn't
hurt to be good about this- prior cleanups have fixed similar
issues.

Leak found by the Coverity scanner.

Not back-patching as I don't see it being worth the code churn.

src/bin/initdb/initdb.c

index 5fc7291ff69be0844f2c78978d427cdf94c69c0e..f66f5302883a7d58e8ff313aee19f74e22d60ddf 100644 (file)
@@ -3309,6 +3309,7 @@ create_xlog_symlink(void)
                fprintf(stderr, _("%s: symlinks are not supported on this platform"));
                exit_nicely();
 #endif
+               free(linkloc);
        }
 }