summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-11-02 13:01:58 +0100
committerGünther Deschner <gd@samba.org>2009-11-02 13:04:26 +0100
commitf35a1b95aa6f50cb1bc919f4ab502ef2c38f6bf5 (patch)
tree57a496ecba77d6ce898c46f77c3b72e5e3651b9d /source3/lib
parentad6ee94950c0977463194b64faee9b012049bfd0 (diff)
downloadsamba-f35a1b95aa6f50cb1bc919f4ab502ef2c38f6bf5.tar.gz
samba-f35a1b95aa6f50cb1bc919f4ab502ef2c38f6bf5.tar.bz2
samba-f35a1b95aa6f50cb1bc919f4ab502ef2c38f6bf5.zip
s3-gencache: restore gencache_get behavior with NULL args (with torture test).
Without this, we panic in wins_srv_is_dead() and fail to start nmbd with wins support. Volker, please check. Guenther
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/gencache.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source3/lib/gencache.c b/source3/lib/gencache.c
index 6de653fa17..4889d7ca62 100644
--- a/source3/lib/gencache.c
+++ b/source3/lib/gencache.c
@@ -529,11 +529,15 @@ bool gencache_get(const char *keystr, char **value, time_t *ptimeout)
SAFE_FREE(blob.data);
return false;
}
- *value = SMB_STRDUP((char *)blob.data);
- data_blob_free(&blob);
- if (*value == NULL) {
- return false;
+ if (value) {
+ *value = SMB_STRDUP((char *)blob.data);
+ data_blob_free(&blob);
+ if (*value == NULL) {
+ return false;
+ }
+ return true;
}
+ data_blob_free(&blob);
return true;
}