[sr-dev] [kamailio/kamailio] presence_reginfo: Add option for aggregating reginfo presentities (PR #3240)

Matteo notifications at github.com
Thu Sep 22 09:34:39 CEST 2022


@xadhoom commented on this pull request.



> +				}
+			} // end of loop over registration elements
+		}
+	} // end of loop over all bodies
+
+	// convert to string & cleanup
+	xml_array = (xmlDocPtr *)pkg_malloc(n * sizeof(xmlDocPtr));
+	if(xml_array == NULL) {
+		LM_ERR("while allocating memory");
+		return NULL;
+	}
+	memset(xml_array, 0, n * sizeof(xmlDocPtr));
+
+	body = (str *)pkg_malloc(sizeof(str));
+	if(body == NULL) {
+		ERR_MEM(PKG_MEM_STR);

Well, ERR_MEM does implicit goto to error where the memory is cleaned. The 2nd alloc of xml_array was a typo and has been removed. Now we have a single xml_array that's freed in the error handling. or not?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3240#discussion_r977300634
You are receiving this because you are subscribed to this thread.

Message ID: <kamailio/kamailio/pull/3240/review/1116528090 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20220922/fc72c2e0/attachment.htm>


More information about the sr-dev mailing list