[Frugalware-git] fwife: util: fix a memleak in fwife_log()

Elentir elentir at frugalware.org
Fri Jun 4 22:37:59 CEST 2010


Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=fwife.git;a=commitdiff;h=986aad8e02e73b96a3e7b0a219fb2c011ecde70d

commit 986aad8e02e73b96a3e7b0a219fb2c011ecde70d
Author: Elentir <elentir at frugalware.org>
Date:   Fri Jun 4 22:35:10 2010 +0200

util: fix a memleak in fwife_log()

diff --git a/src/util.c b/src/util.c
index 9ce70e7..1473c9b 100644
--- a/src/util.c
+++ b/src/util.c
@@ -352,7 +352,7 @@ int fwife_log(char *file, int line, char *fmt, ...)
}
else
{
-		FREE(ptr);
+		free(ptr);
ptr = strdup(LOGFILE);
}
if(!lfp)
@@ -365,6 +365,7 @@ int fwife_log(char *file, int line, char *fmt, ...)
fflush(ldp);
fprintf(lfp, "%s:%d: %s\n", file, line, str);
fflush(lfp);
+	free(ptr);
return(0);
}


More information about the Frugalware-git mailing list