Module: kamailio
Branch: 4.4
Commit: 1c740e85cabe62dec9314589dd0cb0141ffd1010
URL:
https://github.com/kamailio/kamailio/commit/1c740e85cabe62dec9314589dd0cb01…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2016-09-19T20:59:26+02:00
presence: free db result when get_dialog_state() retrieves no rows
- db result and columns in the query are allocated
(cherry picked from commit 7289417c39939f61ea116fe8dc8d23cdea6401be)
---
Modified: modules/presence/presentity.c
---
Diff:
https://github.com/kamailio/kamailio/commit/1c740e85cabe62dec9314589dd0cb01…
Patch:
https://github.com/kamailio/kamailio/commit/1c740e85cabe62dec9314589dd0cb01…
---
diff --git a/modules/presence/presentity.c b/modules/presence/presentity.c
index b5d7b65..d81b90e 100644
--- a/modules/presence/presentity.c
+++ b/modules/presence/presentity.c
@@ -503,9 +503,11 @@ int get_dialog_state(presentity_t* presentity, char** state)
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++)