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

Lines changed: 5 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy