From 2c659fa15d85398074800bdd24170b61d0072c9c Mon Sep 17 00:00:00 2001 From: Thomas Osterried Date: Sat, 16 Dec 2006 10:44:03 +0000 Subject: assure to free pwd from read_pwd() --- ax25/axspawn.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'ax25') diff --git a/ax25/axspawn.c b/ax25/axspawn.c index 4345025..6f3bc94 100644 --- a/ax25/axspawn.c +++ b/ax25/axspawn.c @@ -1,6 +1,6 @@ /* * - * $Id: axspawn.c,v 1.9 2006/12/10 16:44:39 dl9sau Exp $ + * $Id: axspawn.c,v 1.10 2006/12/16 10:44:03 dl9sau Exp $ * * axspawn.c - run a program from ax25d. * @@ -1547,6 +1547,9 @@ again: *p = 0; if ((pwtype & PW_MD5) && !strcmp(buf, "sys") && (pwtype_orig & PW_SYS)) { pwtype = (pwtype_orig & ~PW_MD5); + if (pwd) + free(pwd); + pwd = 0; goto again; } if (!strstr(buf, pass_want)) { @@ -1555,7 +1558,9 @@ again: sleep (EXITDELAY); return -11; } - free(pwd); + if (pwd) + free(pwd); + pwd = 0; } else { if (pw->pw_uid == 0 || pw->pw_gid == 0) { sprintf(buf, "Sorry, root logins are only allowed with md5- or baycom-password!\r"); @@ -1565,6 +1570,9 @@ again: return 1; } } + if (pwd) + free(pwd); + pwd = 0; /* * associate UID with callsign (or vice versa?) -- cgit v1.2.3