From: Daniel Ottavio Date: Thu, 12 May 2005 23:01:25 +0000 (+0000) Subject: * amd/amd.c (main) : fixed memory leak detected by valgrind X-Git-Tag: am-utils-6_1_rc4~2 X-Git-Url: https://git.fsl.cs.sunysb.edu/?a=commitdiff_plain;h=8c4b10c633f06d03ab8729bd6c239bf0efb37a79;p=am-utils-6.2.git * amd/amd.c (main) : fixed memory leak detected by valgrind * amd/info_ldap.c (amu_ldap_init) : fixed memory leak detected by valgrind --- diff --git a/ChangeLog b/ChangeLog index 48ca4243..a54148f3 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 f091c378..de41fc36 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 6b78cb4e..ca4cab9a 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 = "";