From: José Bollo Date: Tue, 24 May 2016 15:20:45 +0000 (+0200) Subject: avoid to free the same pointer X-Git-Tag: blowfish_2.0.1~76 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=2d567b0a2f5251d8808088065085e3173022489f;p=src%2Fapp-framework-binder.git avoid to free the same pointer Change-Id: I0cf860c42046dd3819416688db24a2cd51c3f3aa Signed-off-by: José Bollo --- 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); }