summaryrefslogtreecommitdiff
path: root/nsswitch
diff options
context:
space:
mode:
Diffstat (limited to 'nsswitch')
-rw-r--r--nsswitch/libwbclient/wbclient.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/nsswitch/libwbclient/wbclient.c b/nsswitch/libwbclient/wbclient.c
index 15be255d45..19bb3e9e0a 100644
--- a/nsswitch/libwbclient/wbclient.c
+++ b/nsswitch/libwbclient/wbclient.c
@@ -148,6 +148,7 @@ const char *wbcErrorString(wbcErr error)
}
#define WBC_MAGIC (0x7a2b0e1e)
+#define WBC_MAGIC_FREE (0x875634fe)
struct wbcMemPrefix {
uint32_t magic;
@@ -197,6 +198,10 @@ void wbcFreeMemory(void *p)
if (wbcMem->magic != WBC_MAGIC) {
return;
}
+
+ /* paranoid check to ensure we don't double free */
+ wbcMem->magic = WBC_MAGIC_FREE;
+
if (wbcMem->destructor != NULL) {
wbcMem->destructor(p);
}