[sr-dev] git:4.4:659b9122: presence: Fix memory leak in DB code
Daniel-Constantin Mierla
miconda at gmail.com
Mon Sep 19 23:05:53 CEST 2016
Module: kamailio
Branch: 4.4
Commit: 659b912231d81dff8eac2b486f39919f0b7c45cb
URL: https://github.com/kamailio/kamailio/commit/659b912231d81dff8eac2b486f39919f0b7c45cb
Author: Phil Lavin <phil at lavin.me.uk>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2016-09-19T23:05:38+02:00
presence: Fix memory leak in DB code
(cherry picked from commit 0c36c1b62efef176ae6e9322f14096e3a63ed348)
---
Modified: modules/presence/presentity.c
---
Diff: https://github.com/kamailio/kamailio/commit/659b912231d81dff8eac2b486f39919f0b7c45cb.diff
Patch: https://github.com/kamailio/kamailio/commit/659b912231d81dff8eac2b486f39919f0b7c45cb.patch
---
diff --git a/modules/presence/presentity.c b/modules/presence/presentity.c
index d81b90e..e601153 100644
--- a/modules/presence/presentity.c
+++ b/modules/presence/presentity.c
@@ -396,9 +396,11 @@ int delete_presentity_if_dialog_id_exists(presentity_t* presentity, char* dialog
if(result == NULL)
return -3;
- // No results from query definitely means no dialog exists
- if (result->n <= 0)
+ /* no results from query definitely means no dialog exists */
+ if (result->n <= 0) {
+ pa_dbf.free_result(pa_db, result);
return 0;
+ }
// Loop the rows returned from the DB
for (i=0; i < result->n; i++)
More information about the sr-dev
mailing list