celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pnol...@apache.org
Subject [1/3] celix git commit: CELIX-273: Fixed a mem leak in dfi
Date Thu, 05 Nov 2015 15:42:03 GMT
Repository: celix
Updated Branches:
  refs/heads/develop f119c346e -> fbc4dea3e


CELIX-273: Fixed a mem leak in dfi


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

Branch: refs/heads/develop
Commit: b61330227448ce7a553df932148c522a6b79906e
Parents: f119c34
Author: Pepijn Noltes <pepijnnoltes@gmail.com>
Authored: Thu Nov 5 16:20:17 2015 +0100
Committer: Pepijn Noltes <pepijnnoltes@gmail.com>
Committed: Thu Nov 5 16:20:17 2015 +0100

----------------------------------------------------------------------
 .../dynamic_function_interface/dyn_interface.c         |  4 ++--
 .../dynamic_function_interface/json_rpc.c              | 13 +++++--------
 2 files changed, 7 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/b6133022/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_interface.c
----------------------------------------------------------------------
diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_interface.c
b/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_interface.c
index a50c644..d217d65 100644
--- a/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_interface.c
+++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_interface.c
@@ -34,8 +34,8 @@ struct _dyn_interface_type {
     struct methods_head methods;
 };
 
-const int OK = 0;
-const int ERROR = 1;
+static const int OK = 0;
+static const int ERROR = 1;
 
 static int dynInterface_parseSection(dyn_interface_type *intf, FILE *stream);
 static int dynInterface_parseAnnotations(dyn_interface_type *intf, FILE *stream);

http://git-wip-us.apache.org/repos/asf/celix/blob/b6133022/remote_services/remote_service_admin_dfi/dynamic_function_interface/json_rpc.c
----------------------------------------------------------------------
diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface/json_rpc.c
b/remote_services/remote_service_admin_dfi/dynamic_function_interface/json_rpc.c
index 28ee0d5..dea4f7a 100644
--- a/remote_services/remote_service_admin_dfi/dynamic_function_interface/json_rpc.c
+++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface/json_rpc.c
@@ -166,8 +166,8 @@ int jsonRpc_call(dyn_interface_type *intf, void *service, const char *request,
c
                     }
                     if (dynType_descriptorType(typedType) == 't') {
                         status = jsonSerializer_serializeJson(typedType, (void*) &ptr,
&jsonResult);
-                    }
-                    else {
+                        free(ptr);
+                    } else {
                         dyn_type *typedTypedType = NULL;
                         if (status == OK) {
                             status = dynType_typedPointer_getTypedType(typedType, &typedTypedType);
@@ -310,15 +310,12 @@ int jsonRpc_handleReply(dyn_function_type *func, const char *reply,
void *args[]
                 dynType_typedPointer_getTypedType(argType, &subType);
 
                 if (dynType_descriptorType(subType) == 't') {
-                    void* tmp = NULL;
-                    status = jsonSerializer_deserializeJson(subType, result, &tmp);
                     void ***out = (void ***) args[i];
-                    **out = * (void**) tmp;
-                }
-                else {
+                    status = jsonSerializer_deserializeJson(subType, result, *out);
+                } else {
                     dyn_type *subSubType = NULL;
                     dynType_typedPointer_getTypedType(subType, &subSubType);
-                    void **out = (void **) args[i];
+                    void ***out = (void ***) args[i];
                     status = jsonSerializer_deserializeJson(subSubType, result, *out);
                 }
             } else {


Mime
View raw message