From ccdb8a70f5c5abd288c7cdab6569d02d09894ca4 Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Sun, 7 Feb 2010 10:54:17 -0500 Subject: replace.h: add SAFE_FREE Signed-off-by: Jeff Layton --- replace.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'replace.h') diff --git a/replace.h b/replace.h index 27daf2a..7f29338 100644 --- a/replace.h +++ b/replace.h @@ -710,4 +710,8 @@ char *ufc_crypt(const char *key, const char *salt); #endif #endif +#ifndef SAFE_FREE +#define SAFE_FREE(x) do { if ((x) != NULL) {free(x); x=NULL;} } while(0) +#endif + #endif /* _LIBREPLACE_REPLACE_H */ -- cgit v1.2.3