diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/lib/gencache.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/source3/lib/gencache.c b/source3/lib/gencache.c index 2f603dbb2d..d3631b96ee 100644 --- a/source3/lib/gencache.c +++ b/source3/lib/gencache.c @@ -208,9 +208,9 @@ done: bool gencache_del(const char *keystr) { - bool exists; + bool exists, was_expired; bool ret = false; - char *value; + DATA_BLOB value; if (keystr == NULL) { return false; @@ -226,9 +226,18 @@ bool gencache_del(const char *keystr) * element. */ - exists = gencache_get(keystr, &value, NULL); + exists = gencache_get_data_blob(keystr, &value, NULL, &was_expired); + + if (!exists && was_expired) { + /* + * gencache_get_data_blob has implicitly deleted this + * entry, so we have to return success here. + */ + return true; + } + if (exists) { - SAFE_FREE(value); + data_blob_free(&value); ret = gencache_set(keystr, "", 0); } return ret; |