Fixed leaks in pubsub
@@ -212,6 +212,9 @@ celix_status_t pubsubEndpoint_createFromServiceReference(bundle_context_t *ctx,
const char *pubsubType = isPublisher ? PUBSUB_PUBLISHER_ENDPOINT_TYPE : PUBSUB_SUBSCRIBER_ENDPOINT_TYPE;
pubsubEndpoint_setFields(ep, fwUUID, scope, topic, bundleId, strtol(serviceId,NULL,10), NULL, pubsubType, topic_props);
+ if(topic_props != NULL){
+ celix_properties_destroy(topic_props); //Can be deleted since setFields invokes properties_copy
+ }
if (!pubsubEndpoint_isEndpointValid(ep)) {
status = CELIX_ILLEGAL_STATE;
@@ -286,6 +289,9 @@ celix_status_t pubsubEndpoint_createFromListenerHookInfo(bundle_context_t *ctx,
pubsubEndpoint_setFields(psEp, fwUUID, scope, topic, bundleId, -1, NULL, PUBSUB_PUBLISHER_ENDPOINT_TYPE, topic_props);
free(scope);
free(topic);
+ if(topic_props != NULL){
+ celix_properties_destroy(topic_props); //Can be deleted since setFields invokes properties_copy
+ }
if (!pubsubEndpoint_isEndpointValid(psEp)) {
status = CELIX_ILLEGAL_STATE;
