summaryrefslogtreecommitdiff
path: root/build/names.c
diff options
context:
space:
mode:
authorjbj <devnull@localhost>1999-10-29 16:06:01 +0000
committerjbj <devnull@localhost>1999-10-29 16:06:01 +0000
commit1e0138188b4887431444d90395be0f2fac5c2db3 (patch)
tree921cdb01039a413878fd312ff4656c75dc32a4db /build/names.c
parent0d0b405c201b43f2eebc61257f5992931e1cdb0c (diff)
downloadrpm-1e0138188b4887431444d90395be0f2fac5c2db3.tar.gz
rpm-1e0138188b4887431444d90395be0f2fac5c2db3.tar.bz2
rpm-1e0138188b4887431444d90395be0f2fac5c2db3.zip
check for memory leaks (almost all leaks are plugged).
CVS patchset: 3403 CVS date: 1999/10/29 16:06:01
Diffstat (limited to 'build/names.c')
-rw-r--r--build/names.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/build/names.c b/build/names.c
index 806bb617c..60ef5b684 100644
--- a/build/names.c
+++ b/build/names.c
@@ -5,13 +5,22 @@
#include "rpmbuild.h"
static uid_t uids[1024];
-/*@owned@*/ /*@null@*/ static char *unames[1024];
+/*@owned@*/ /*@null@*/ static const char *unames[1024];
static int uid_used = 0;
static gid_t gids[1024];
-/*@owned@*/ /*@null@*/ static char *gnames[1024];
+/*@owned@*/ /*@null@*/ static const char *gnames[1024];
static int gid_used = 0;
+void freeNames(void)
+{
+ int x;
+ for (x = 0; x < uid_used; x++)
+ xfree(unames[x]);
+ for (x = 0; x < gid_used; x++)
+ xfree(gnames[x]);
+}
+
/*
* getUname() takes a uid, gets the username, and creates an entry in the
* table to hold a string containing the user name.