diff options
author | Dmitri Pal <dpal@redhat.com> | 2009-04-14 14:55:42 -0400 |
---|---|---|
committer | Simo Sorce <ssorce@redhat.com> | 2009-04-14 17:13:40 -0400 |
commit | 62a6ee4a83f90015d69645b72e7878c2febd7e00 (patch) | |
tree | a561291d397698d4ac7f30b3ea5654ce3a6b72bd /ini/ini_config_ut.c | |
parent | 29e5e0dd98ed26902fb73f3565dfa2beb2ddbead (diff) | |
download | ding-libs-62a6ee4a83f90015d69645b72e7878c2febd7e00.tar.gz ding-libs-62a6ee4a83f90015d69645b72e7878c2febd7e00.tar.xz ding-libs-62a6ee4a83f90015d69645b72e7878c2febd7e00.zip |
Fixing memory issues in ini and collection
The read_line() function used an internal buffer allocated on stack
as temporary storage for a line read from file, then returned it.
read_line() now gets a buffer from the caller.
Fixed memory leaks in INI and Collection found by valgrind.
Diffstat (limited to 'ini/ini_config_ut.c')
-rw-r--r-- | ini/ini_config_ut.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ini/ini_config_ut.c b/ini/ini_config_ut.c index 6787c36..5441e02 100644 --- a/ini/ini_config_ut.c +++ b/ini/ini_config_ut.c @@ -303,7 +303,6 @@ int get_test() debug_item(item); - printf("Get item as string without duplication from NULL item.\n"); /* Get a string without duplicication */ @@ -759,9 +758,10 @@ int get_test() return -1; } - for (i=0;i<size;i++) printf("Section: [%s]\n", prop_array[i]); + for (i=0;i<size;i++) printf("Attribute: [%s]\n", prop_array[i]); free_attribute_list(prop_array); + destroy_collection(ini_config); printf("Done with get test!\n"); return EOK; } |