1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-31 22:04:40 +03:00

Add some minor missing error checks

This commit is contained in:
Alvaro Herrera
2010-12-16 12:22:08 -03:00
parent 16ca75baeb
commit e359b8496d

View File

@ -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))