diff options
author | Lukas Slebodnik <lslebodn@redhat.com> | 2014-11-15 22:33:34 +0100 |
---|---|---|
committer | Simo Sorce <simo@redhat.com> | 2015-01-15 13:36:42 -0500 |
commit | 5a99c4873bd79adf8359370869469f745eec8c35 (patch) | |
tree | ce846ab7cbd76e88bd3c84f9d21502205b55effa /proxy/src | |
parent | 09a2c4ac42afdedbcdec3c4b2a430a892cc5aab4 (diff) | |
download | gss-proxy-5a99c4873bd79adf8359370869469f745eec8c35.tar.gz gss-proxy-5a99c4873bd79adf8359370869469f745eec8c35.tar.xz gss-proxy-5a99c4873bd79adf8359370869469f745eec8c35.zip |
Fix memory leak
Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com>
Diffstat (limited to 'proxy/src')
-rw-r--r-- | proxy/src/gp_config_dinglibs.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/proxy/src/gp_config_dinglibs.c b/proxy/src/gp_config_dinglibs.c index 515b951..d2bd0e4 100644 --- a/proxy/src/gp_config_dinglibs.c +++ b/proxy/src/gp_config_dinglibs.c @@ -87,6 +87,7 @@ int gp_dinglibs_get_string_array(struct gp_ini_context *ctx, int ret; int i, count = 0; const char **array = NULL; + const char **t_array; if (!values || !num_values) { return EINVAL; @@ -144,11 +145,12 @@ int gp_dinglibs_get_string_array(struct gp_ini_context *ctx, goto done; } - array = realloc(array, (count+1) * sizeof(char *)); - if (array == NULL) { + t_array = realloc(array, (count+1) * sizeof(char *)); + if (t_array == NULL) { ret = ENOMEM; goto done; } + array = t_array; array[count] = strdup(value); if (array[count] == NULL) { |