summaryrefslogtreecommitdiff
path: root/replace.h
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2010-02-07 10:54:17 -0500
committerJeff Layton <jlayton@redhat.com>2010-02-07 10:54:17 -0500
commitccdb8a70f5c5abd288c7cdab6569d02d09894ca4 (patch)
treeeebbbe6ead9fd58374db1ea628a56f88a08f2213 /replace.h
parent6479cc23ac75cd19b795e18a6ae4a4ead6df843c (diff)
downloadcifs-utils-ccdb8a70f5c5abd288c7cdab6569d02d09894ca4.tar.gz
cifs-utils-ccdb8a70f5c5abd288c7cdab6569d02d09894ca4.tar.bz2
cifs-utils-ccdb8a70f5c5abd288c7cdab6569d02d09894ca4.zip
replace.h: add SAFE_FREE
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Diffstat (limited to 'replace.h')
-rw-r--r--replace.h4
1 files changed, 4 insertions, 0 deletions
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 */