diff options
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/gencache.c | 12 |
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; } |