=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/finger/util.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- src/usr.bin/finger/util.c 1997/06/30 06:24:47 1.8 +++ src/usr.bin/finger/util.c 1998/01/09 17:17:39 1.9 @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.8 1997/06/30 06:24:47 deraadt Exp $ */ +/* $OpenBSD: util.c,v 1.9 1998/01/09 17:17:39 millert Exp $ */ /* * Copyright (c) 1989 The Regents of the University of California. @@ -39,7 +39,7 @@ #ifndef lint /*static char sccsid[] = "from: @(#)util.c 5.14 (Berkeley) 1/17/91";*/ -static char rcsid[] = "$OpenBSD: util.c,v 1.8 1997/06/30 06:24:47 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: util.c,v 1.9 1998/01/09 17:17:39 millert Exp $"; #endif /* not lint */ #include @@ -384,17 +384,14 @@ /* Like strvis(), but use malloc() to get the space and return a pointer * to the beginning of the converted string, not the end. * - * Recycle the malloc()ed area on each call. This leads to a leak which - * does not grow. + * The caller is responsible for free()'ing the returned string. */ char * vs(src) char *src; { - static char *dst = NULL; + char *dst; - if (dst != NULL) - free(dst); if ((dst = malloc((4 * strlen(src)) + 1)) == NULL) err(1, "malloc failed");