X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=resource%2Fcsdk%2Fconnectivity%2Fcommon%2Fsrc%2Foic_logger.c;h=9347c27ce93754cd34428aa440a7e44705682861;hb=8c01dff2c5bc5496f7dc1632c498943ec6ecb015;hp=46106c655f07aa9428dca14c2fd65136f94b6fff;hpb=935fdb9b67b6c10d007e652e9e2e028fd6ccfe09;p=platform%2Fupstream%2Fiotivity.git diff --git a/resource/csdk/connectivity/common/src/oic_logger.c b/resource/csdk/connectivity/common/src/oic_logger.c index 46106c6..9347c27 100644 --- a/resource/csdk/connectivity/common/src/oic_logger.c +++ b/resource/csdk/connectivity/common/src/oic_logger.c @@ -19,6 +19,7 @@ //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= #include "oic_logger.h" +#include "oic_string.h" #include #include @@ -123,16 +124,12 @@ size_t oic_log_write_level(oic_log_ctx_t *ctx, const oic_log_level ll, const cha int oic_log_set_module(oic_log_ctx_t *ctx, const char *module_name) { char *mn; - size_t l; if (0 == ctx) return 0; /* Swap pointers so that module data's not erased in the event of failure: */ - l = strlen(module_name); - - mn = (char *) malloc(1 + l); - + mn = OICStrdup(module_name); if (0 == mn) { if (0 != ctx->module_name) @@ -140,8 +137,6 @@ int oic_log_set_module(oic_log_ctx_t *ctx, const char *module_name) return 0; } - memcpy(mn, module_name, 1 + l); - if (0 != ctx->module_name) free(ctx->module_name);