=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/sudo/Attic/alloc.c,v retrieving revision 1.8 retrieving revision 1.9 diff -c -r1.8 -r1.9 *** src/usr.bin/sudo/Attic/alloc.c 2004/09/28 15:10:50 1.8 --- src/usr.bin/sudo/Attic/alloc.c 2007/07/26 16:10:15 1.9 *************** *** 1,5 **** /* ! * Copyright (c) 1999-2003 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above --- 1,5 ---- /* ! * Copyright (c) 1999-2005 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above *************** *** 18,24 **** * Materiel Command, USAF, under agreement number F39502-99-1-0512. */ ! #include "config.h" #include #include --- 18,24 ---- * Materiel Command, USAF, under agreement number F39502-99-1-0512. */ ! #include #include #include *************** *** 50,56 **** #include "sudo.h" #ifndef lint ! static const char rcsid[] = "$Sudo: alloc.c,v 1.23 2004/06/01 16:23:32 millert Exp $"; #endif /* lint */ /* --- 50,56 ---- #include "sudo.h" #ifndef lint ! __unused static const char rcsid[] = "$Sudo: alloc.c,v 1.23.2.3 2007/06/12 01:43:01 millert Exp $"; #endif /* lint */ /* *************** *** 179,185 **** #ifdef __STDC__ easprintf(char **ret, const char *fmt, ...) #else ! easprintf(va_alist) va_dcl #endif { --- 179,187 ---- #ifdef __STDC__ easprintf(char **ret, const char *fmt, ...) #else ! easprintf(ret, fmt, va_alist) ! char **ret; ! const char *fmt; va_dcl #endif { *************** *** 188,199 **** #ifdef __STDC__ va_start(ap, fmt); #else - char **ret; - const char *fmt; - va_start(ap); - ret = va_arg(ap, char **); - fmt = va_arg(ap, const char *); #endif len = vasprintf(ret, fmt, ap); va_end(ap); --- 190,196 ---- *************** *** 218,221 **** --- 215,229 ---- if ((len = vasprintf(ret, format, args)) == -1) errx(1, "unable to allocate memory"); return(len); + } + + /* + * Wrapper for free(3) so we can depend on C89 semantics. + */ + void + efree(ptr) + VOID *ptr; + { + if (ptr != NULL) + free(ptr); }