From: Alvaro Herrera Date: Thu, 16 Dec 2010 15:22:08 +0000 (-0300) Subject: Add some minor missing error checks X-Git-Url: http://waps.l3s.uni-hannover.de/gitweb/?a=commitdiff_plain;h=e359b8496d11befb63d4734874d997909c44ad83;p=users%2Fhanada%2Fpostgres.git Add some minor missing error checks --- diff --git a/src/port/win32env.c b/src/port/win32env.c index 8e9b948c52..42f0326805 100644 --- a/src/port/win32env.c +++ b/src/port/win32env.c @@ -115,9 +115,14 @@ pgwin32_putenv(const char *envval) * Need a copy of the string so we can modify it. */ envcpy = strdup(envval); + if (!envcpy) + return -1; cp = strchr(envcpy, '='); if (cp == NULL) + { + free(envcpy); return -1; + } *cp = '\0'; cp++; if (strlen(cp))