summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/session.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/session.c b/src/session.c
index e847a6d5..16dc8369 100644
--- a/src/session.c
+++ b/src/session.c
@@ -463,6 +463,6 @@ void ctxClientValueSet(struct AFB_clientCtx *clientCtx, int index, void *value,
assert(index < sessions.apicount);
prev = clientCtx->values[index];
clientCtx->values[index] = (struct client_value){.value = value, .free_value = free_value};
- if (prev.value != NULL && prev.free_value != NULL)
+ if (prev.value != NULL && prev.value != value && prev.free_value != NULL)
prev.free_value(prev.value);
}