summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorewt <devnull@localhost>1996-10-21 01:24:25 +0000
committerewt <devnull@localhost>1996-10-21 01:24:25 +0000
commitaca34134701ccc3254f343f7150f6c261ec88198 (patch)
tree3fe4f8023efe5b17e805f95e42a72a3a658d9f2c
parent9d5ce56fe4d71cbe053d060d0c696c72854b805c (diff)
downloadrpm-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.c15
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;
}