2
0
Эх сурвалжийг харах

presence: free db result when get_dialog_state() retrieves no rows

- db result and columns in the query are allocated
Daniel-Constantin Mierla 9 жил өмнө
parent
commit
7289417c39

+ 4 - 2
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++)