postgres.git / summary / log / commit / refs
commit e359b8496d11befb63d4734874d997909c44ad83
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: Thu Dec 16 15:22:08 2010 +0000
First released in: 9.1.0
Add some minor missing error checks
src/port/win32env.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/port/win32env.c b/src/port/win32env.c
index 8e9b948c528..42f03268052 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))
[parent: 16ca75baebc5]