From 832ee39994afccacf287b16aa8c66aee7be18d11 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Tue, 21 Apr 2015 22:18:09 -0400 Subject: [PATCH] YFS Coverity 11034 Change-Id: I5037b7e6d804e6a61e02258927f06d24cc0b2051 --- lib/krb5/config_file.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/krb5/config_file.c b/lib/krb5/config_file.c index 44d441fdd..3c0b0a447 100644 --- a/lib/krb5/config_file.c +++ b/lib/krb5/config_file.c @@ -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); -- 2.11.4.GIT