Commit e359b849 authored by Alvaro Herrera's avatar Alvaro Herrera

Add some minor missing error checks

parent 16ca75ba
...@@ -115,9 +115,14 @@ pgwin32_putenv(const char *envval) ...@@ -115,9 +115,14 @@ pgwin32_putenv(const char *envval)
* Need a copy of the string so we can modify it. * Need a copy of the string so we can modify it.
*/ */
envcpy = strdup(envval); envcpy = strdup(envval);
if (!envcpy)
return -1;
cp = strchr(envcpy, '='); cp = strchr(envcpy, '=');
if (cp == NULL) if (cp == NULL)
{
free(envcpy);
return -1; return -1;
}
*cp = '\0'; *cp = '\0';
cp++; cp++;
if (strlen(cp)) if (strlen(cp))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment