diff options
author | ewt <devnull@localhost> | 1996-10-21 01:24:25 +0000 |
---|---|---|
committer | ewt <devnull@localhost> | 1996-10-21 01:24:25 +0000 |
commit | aca34134701ccc3254f343f7150f6c261ec88198 (patch) | |
tree | 3fe4f8023efe5b17e805f95e42a72a3a658d9f2c | |
parent | 9d5ce56fe4d71cbe053d060d0c696c72854b805c (diff) | |
download | rpm-aca34134701ccc3254f343f7150f6c261ec88198.tar.gz rpm-aca34134701ccc3254f343f7150f6c261ec88198.tar.bz2 rpm-aca34134701ccc3254f343f7150f6c261ec88198.zip |
1) free matches in findSharedFiles()
2) if no matches are found in findSharedFiles() free memory and return
NULL ptr
CVS patchset: 1121
CVS date: 1996/10/21 01:24:25
-rw-r--r-- | lib/uninstall.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/uninstall.c b/lib/uninstall.c index 9bdc1a671..5d9cdb665 100644 --- a/lib/uninstall.c +++ b/lib/uninstall.c @@ -69,13 +69,20 @@ int findSharedFiles(rpmdb db, int offset, char ** fileList, int fileCount, itemsUsed++; } } + + freeDBIndexRecord(matches); } } - qsort(list, itemsUsed, sizeof(struct sharedFile), sharedFileCmp); - - *listPtr = list; - *listCountPtr = itemsUsed; + if (itemsUsed) { + qsort(list, itemsUsed, sizeof(struct sharedFile), sharedFileCmp); + *listPtr = list; + *listCountPtr = itemsUsed; + } else { + free(list); + *listPtr = NULL; + *listCountPtr = 0; + } return 0; } |