You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by pn...@apache.org on 2018/10/16 10:31:12 UTC

celix git commit: CELIX-454: Correct wrong mem free in the pubsub match functions

Repository: celix
Updated Branches:
  refs/heads/develop c3f2e8205 -> 3b56bcebc


CELIX-454: Correct wrong mem free in the pubsub match functions


Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/3b56bceb
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/3b56bceb
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/3b56bceb

Branch: refs/heads/develop
Commit: 3b56bcebc268567db1a0366d8afc1dcc3a875a97
Parents: c3f2e82
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Tue Oct 16 12:30:34 2018 +0200
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Tue Oct 16 12:30:34 2018 +0200

----------------------------------------------------------------------
 bundles/pubsub/pubsub_spi/src/pubsub_utils_match.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/3b56bceb/bundles/pubsub/pubsub_spi/src/pubsub_utils_match.c
----------------------------------------------------------------------
diff --git a/bundles/pubsub/pubsub_spi/src/pubsub_utils_match.c b/bundles/pubsub/pubsub_spi/src/pubsub_utils_match.c
index 9f303ba..bbe4fe7 100644
--- a/bundles/pubsub/pubsub_spi/src/pubsub_utils_match.c
+++ b/bundles/pubsub/pubsub_spi/src/pubsub_utils_match.c
@@ -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;
 }