Browse code

Merge pull request #1435 from kamailio/cchance/presence

presence: delay freeing generated etag string

Charles Chance authored on 09/02/2018 15:02:42 • GitHub committed on 09/02/2018 15:02:42
Showing 1 changed files
... ...
@@ -1100,10 +1100,6 @@ after_etag_generation:
1100 1100
 				}
1101 1101
 				if (sent_reply) *sent_reply= 1;
1102 1102
 
1103
-				if(etag.s)
1104
-					pkg_free(etag.s);
1105
-				etag.s= NULL;
1106
-
1107 1103
 				goto done;
1108 1104
 			}
1109 1105
 		}
... ...
@@ -1232,10 +1228,6 @@ after_etag_generation:
1232 1228
 		}
1233 1229
 		if (sent_reply) *sent_reply= 1;
1234 1230
 
1235
-		if(etag.s)
1236
-			pkg_free(etag.s);
1237
-		etag.s= NULL;
1238
-
1239 1231
 		if(!body)
1240 1232
 			goto done;
1241 1233
 	}
... ...
@@ -1266,6 +1258,10 @@ done:
1266 1258
 		pres_dmq_replicate_presentity(presentity, body, new_t, &cur_etag, sphere, &p_ruid, NULL);
1267 1259
 	}
1268 1260
 
1261
+	if(etag.s)
1262
+		pkg_free(etag.s);
1263
+	etag.s= NULL;
1264
+
1269 1265
 	if(cur_ruid.s)
1270 1266
 		pkg_free(cur_ruid.s);
1271 1267
 	cur_ruid.s= NULL;