From 5b3f085121ba9a534222aa30f1e0e5d452dc88f4 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 1 Jun 2016 19:42:35 +0200 Subject: [PATCH] lime again --- coreapi/lime.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/coreapi/lime.c b/coreapi/lime.c index e7b297dfb..0ce71921d 100644 --- a/coreapi/lime.c +++ b/coreapi/lime.c @@ -465,15 +465,18 @@ void lime_freeKeys(limeURIKeys_t *associatedKeys) { /* free all associated keys */ for (i=0; i< associatedKeys->associatedZIDNumber; i++) { if (associatedKeys->peerKeys[i] != NULL) { + /*shouldn't we memset to zero the content of peerKeys[i] in order clear keys?*/ free(associatedKeys->peerKeys[i]); associatedKeys->peerKeys[i] = NULL; } } free(associatedKeys->peerKeys); + associatedKeys->peerKeys = NULL; /* free sipURI string */ free(associatedKeys->peerURI); + associatedKeys->peerURI = NULL; } int lime_encryptMessage(limeKey_t *key, uint8_t *plainMessage, uint32_t messageLength, uint8_t selfZID[12], uint8_t *encryptedMessage) {