From 8c4b10c633f06d03ab8729bd6c239bf0efb37a79 Mon Sep 17 00:00:00 2001 From: Daniel Ottavio Date: Thu, 12 May 2005 23:01:25 +0000 Subject: [PATCH] * amd/amd.c (main) : fixed memory leak detected by valgrind * amd/info_ldap.c (amu_ldap_init) : fixed memory leak detected by valgrind --- ChangeLog | 7 +++++++ amd/amd.c | 8 +++++--- amd/info_ldap.c | 4 +++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 48ca424..a54148f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-05-11 Daniel P. Ottavio + + * amd/amd.c (main) : fixed memory leak detected by valgrind + + * amd/info_ldap.c (amu_ldap_init) : fixed memory leak detected by + valgrind + 2005-05-11 Erez Zadok * m4/macros/{check_checkmount_style.m4, check_mnttab_style.m4, diff --git a/amd/amd.c b/amd/amd.c index f091c37..de41fc3 100644 --- a/amd/amd.c +++ b/amd/amd.c @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * - * $Id: amd.c,v 1.35 2005/03/08 06:05:33 ezk Exp $ + * $Id: amd.c,v 1.36 2005/05/12 23:01:25 ottavio Exp $ * */ @@ -382,7 +382,7 @@ do_memory_locking(void) int main(int argc, char *argv[]) { - char *domdot, *verstr; + char *domdot, *verstr, *vertmp; int ppid = 0; int error; char *progname = NULL; /* "amd" */ @@ -546,12 +546,14 @@ main(int argc, char *argv[]) /* * Log version information. */ - verstr = strtok(get_version_string(), "\n"); + vertmp = get_version_string(); + verstr = strtok(vertmp, "\n"); plog(XLOG_INFO, "AM-UTILS VERSION INFORMATION:"); while (verstr) { plog(XLOG_INFO, "%s", verstr); verstr = strtok(NULL, "\n"); } + XFREE(vertmp); /* * Get our own IP address so that we can mount the automounter. We pass diff --git a/amd/info_ldap.c b/amd/info_ldap.c index 6b78cb4..ca4cab9 100644 --- a/amd/info_ldap.c +++ b/amd/info_ldap.c @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * - * $Id: info_ldap.c,v 1.24 2005/01/03 20:56:45 ezk Exp $ + * $Id: info_ldap.c,v 1.25 2005/05/12 23:01:25 ottavio Exp $ * */ @@ -245,6 +245,8 @@ amu_ldap_init(mnt_map *m, char *map, time_t *ts) if (aldh->hostent == NULL) { plog(XLOG_USER, "Unable to parse hostport %s for ldap map %s", gopt.ldap_hostports ? gopt.ldap_hostports : "(null)", map); + XFREE(creds); + XFREE(aldh); return (ENOENT); } creds->who = ""; -- 2.43.0