Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit e359b84

Browse files
committed
Add some minor missing error checks
1 parent 16ca75b commit e359b84

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/port/win32env.c

+5
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,14 @@ pgwin32_putenv(const char *envval)
115115
* Need a copy of the string so we can modify it.
116116
*/
117117
envcpy = strdup(envval);
118+
if (!envcpy)
119+
return -1;
118120
cp = strchr(envcpy, '=');
119121
if (cp == NULL)
122+
{
123+
free(envcpy);
120124
return -1;
125+
}
121126
*cp = '\0';
122127
cp++;
123128
if (strlen(cp))

0 commit comments

Comments
 (0)