Correct wrong mem free in the pubsub match functions
@@ -170,15 +170,16 @@ double pubsub_utils_matchSubscriber(
celix_properties_t *ep = data.outEndpoint;
const char *requested_admin = NULL;
const char *requested_qos = NULL;
+ const char *requested_serializer = NULL;
if (ep != NULL) {
requested_admin = celix_properties_get(ep, PUBSUB_ENDPOINT_ADMIN_TYPE, NULL);
requested_qos = celix_properties_get(ep, PUBSUB_UTILS_QOS_ATTRIBUTE_KEY, NULL);
+ requested_serializer = celix_properties_get(ep, PUBSUB_ENDPOINT_SERIALIZER, NULL);
celix_properties_destroy(ep);
}
double score = getPSAScore(requested_admin, requested_qos, adminType, sampleScore, controlScore, defaultScore);
- const char *requested_serializer = celix_properties_get(ep, PUBSUB_ENDPOINT_SERIALIZER, NULL);
long serializerSvcId = getPSASerializer(ctx, requested_serializer);
if (serializerSvcId < 0) {
score = PUBSUB_ADMIN_NO_MATCH_SCORE; //no serializer, no match
@@ -190,10 +191,6 @@ double pubsub_utils_matchSubscriber(
*outSerializerSvcId = serializerSvcId;
}
- if (ep != NULL) {
- celix_properties_destroy(ep);
- }
-
return score;
}
