diff options
author | jbj <devnull@localhost> | 1999-09-21 03:22:53 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 1999-09-21 03:22:53 +0000 |
commit | 20d78e939aa218e85ef19013769494851d863f13 (patch) | |
tree | 9fddb9815dafcdd8e7eb20bb4ec9fe3a80270b39 /build/names.c | |
parent | 78ce864c5eee9b2d4fc3a3a4a201818f4e500d50 (diff) | |
download | librpm-tizen-20d78e939aa218e85ef19013769494851d863f13.tar.gz librpm-tizen-20d78e939aa218e85ef19013769494851d863f13.tar.bz2 librpm-tizen-20d78e939aa218e85ef19013769494851d863f13.zip |
fix: command line install had header memory leak.
check for NULL on all memory allocations.
free rpmrc mallocs on exit.
permit run time leak detection.
CVS patchset: 3311
CVS date: 1999/09/21 03:22:53
Diffstat (limited to 'build/names.c')
-rw-r--r-- | build/names.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/build/names.c b/build/names.c index b30d8a770..5e3b47d7d 100644 --- a/build/names.c +++ b/build/names.c @@ -37,7 +37,7 @@ char *getUname(uid_t uid) uids[x] = uid; uid_used++; if (pw) { - unames[x] = strdup(pw->pw_name); + unames[x] = xstrdup(pw->pw_name); } else { unames[x] = NULL; } @@ -69,10 +69,10 @@ char *getUnameS(const char *uname) uid_used++; if (pw) { uids[x] = pw->pw_uid; - unames[x] = strdup(pw->pw_name); + unames[x] = xstrdup(pw->pw_name); } else { uids[x] = -1; - unames[x] = strdup(uname); + unames[x] = xstrdup(uname); } return unames[x]; } @@ -102,7 +102,7 @@ char *getGname(gid_t gid) gids[x] = gid; gid_used++; if (gr) { - gnames[x] = strdup(gr->gr_name); + gnames[x] = xstrdup(gr->gr_name); } else { gnames[x] = NULL; } @@ -134,10 +134,10 @@ char *getGnameS(const char *gname) gid_used++; if (gr) { gids[x] = gr->gr_gid; - gnames[x] = strdup(gr->gr_name); + gnames[x] = xstrdup(gr->gr_name); } else { gids[x] = -1; - gnames[x] = strdup(gname); + gnames[x] = xstrdup(gname); } return gnames[x]; } |