aboutsummaryrefslogtreecommitdiffstats
path: root/parsehdlist.c
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2000-11-23 18:12:42 +0000
committerFrancois Pons <fpons@mandriva.com>2000-11-23 18:12:42 +0000
commitfe11689c21b50e833a728b5c7d97598991b54651 (patch)
tree65d1adbec62cefe82ab51bab02c7a42fa00b9e33 /parsehdlist.c
parentcef6ffe832833828c044373b7bac83ce20f272ad (diff)
downloadrpmtools-fe11689c21b50e833a728b5c7d97598991b54651.tar
rpmtools-fe11689c21b50e833a728b5c7d97598991b54651.tar.gz
rpmtools-fe11689c21b50e833a728b5c7d97598991b54651.tar.bz2
rpmtools-fe11689c21b50e833a728b5c7d97598991b54651.tar.xz
rpmtools-fe11689c21b50e833a728b5c7d97598991b54651.zip
fixed memory leaks that were causing problems if used interactively.
Diffstat (limited to 'parsehdlist.c')
-rw-r--r--parsehdlist.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/parsehdlist.c b/parsehdlist.c
index a798646..8c40a14 100644
--- a/parsehdlist.c
+++ b/parsehdlist.c
@@ -61,6 +61,7 @@ void print_list(Header header, int_32 tag_name, char *format, char *name) {
if (list)
for(i = 0; i < count; i++)
printf(format, name, list[i]);
+ free(list);
}
static
@@ -87,6 +88,7 @@ void print_list_flags(Header header, int_32 tag_name, int_32 tag_flags, int_32 t
}
printf("\n");
}
+ free(list);
}
static
@@ -102,6 +104,7 @@ void print_list_prereqs(Header header, char *format, char *name) {
if (flags && list)
for(i = 0; i < count; i++)
if (flags[i] & RPMSENSE_PREREQ) printf(format, name, list[i]);
+ free(list);
}
static
@@ -114,9 +117,9 @@ void print_list_files(Header header, char *format, char *name) {
headerGetEntry(header, RPMTAG_OLDFILENAMES, &type, (void **) &list, &count);
- if (list) {
+ if (list)
for (i = 0; i < count; i++) printf(format, name, list[i]);
- }
+ free(list);
headerGetEntry(header, RPMTAG_BASENAMES, &type, (void **) &baseNames, &count);
headerGetEntry(header, RPMTAG_DIRINDEXES, &type, (void **) &dirIndexes, NULL);
@@ -129,6 +132,8 @@ void print_list_files(Header header, char *format, char *name) {
printf(format, name, buff);
}
}
+ free(baseNames);
+ free(dirNames);
}
static