From: flipk Date: Tue, 18 Mar 1997 06:36:51 +0000 (+0000) Subject: fix a memory-leak problem in MDXEnd -- even when given X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=7b015b654606532d7b9749493e02e2870108a4af;p=openbsd fix a memory-leak problem in MDXEnd -- even when given a non-NULL buffer, MDXEnd would go ahead and malloc a new one anyway. --- diff --git a/lib/libc/md/mdXhl.c b/lib/libc/md/mdXhl.c index f44d5940d52..6f5498021fe 100644 --- a/lib/libc/md/mdXhl.c +++ b/lib/libc/md/mdXhl.c @@ -8,7 +8,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: mdXhl.c,v 1.5 1996/11/24 02:25:59 niklas Exp $"; +static char rcsid[] = "$OpenBSD: mdXhl.c,v 1.6 1997/03/18 06:36:51 flipk Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -27,7 +27,7 @@ MDXEnd(ctx, buf) char *buf; { int i; - char *p = malloc(33); + char *p = buf; unsigned char digest[16]; static const char hex[]="0123456789abcdef";