summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 19d7d13)
raw | patch | inline | side by side (parent: 19d7d13)
author | Sebastian Harl <sh@tokkee.org> | |
Sun, 10 Mar 2013 19:30:11 +0000 (20:30 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sun, 10 Mar 2013 19:30:11 +0000 (20:30 +0100) |
src/utils/error.c | patch | blob | history |
diff --git a/src/utils/error.c b/src/utils/error.c
index 34213b319501a7ca13e1d5d10843c6ceb295f4fe..08a77f1c40b9007d9e05dd365dc9a6b07f5e15c3 100644 (file)
--- a/src/utils/error.c
+++ b/src/utils/error.c
#include <stdio.h>
#include <string.h>
+#include <stdlib.h>
+
/*
* private data types
*/
* private helper functions
*/
+static void
+sdb_error_ctx_destructor(void *ctx)
+{
+ if (! ctx)
+ return;
+ free(ctx);
+} /* sdb_error_ctx_destructor */
+
static void
sdb_error_ctx_init(void)
{
if (error_ctx_key_initialized)
return;
- pthread_key_create(&error_ctx_key, NULL);
+ pthread_key_create(&error_ctx_key, sdb_error_ctx_destructor);
error_ctx_key_initialized = 1;
} /* sdb_error_init */