YFS Coverity 11034

Change-Id: I5037b7e6d804e6a61e02258927f06d24cc0b2051
This commit is contained in:
Jeffrey Altman
2015-04-21 22:18:09 -04:00
parent 1e85577f93
commit 832ee39994

View File

@@ -934,13 +934,17 @@ krb5_config_vget_strings(krb5_context context,
s = next_component_string(tmp, " \t", &pos);
while(s){
char **tmp2 = realloc(strings, (nstr + 1) * sizeof(*strings));
if(tmp2 == NULL)
if(tmp2 == NULL) {
free(tmp);
goto cleanup;
}
strings = tmp2;
strings[nstr] = strdup(s);
nstr++;
if(strings[nstr-1] == NULL)
if(strings[nstr-1] == NULL) {
free(tmp);
goto cleanup;
}
s = next_component_string(NULL, " \t", &pos);
}
free(tmp);