API app_get_id allocates memory internally, which was not freed
resulting in possible memory leak.
Signed-off-by: Satya Prakash Gupta <sp.gupta@samsung.com>
Change-Id: Ibc2cc77ebe803f174ab5e7ec5cff18e54178f2a8
Reviewed-on: https://gerrit.iotivity.org/gerrit/1239
Reviewed-by: Madan Lanka <lanka.madan@samsung.com>
Reviewed-by: Harish Marappa <h.marappa@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: Uze Choi <uzchoi@samsung.com>
if (path != ".")
path = "/data/data/" + path + "/files";
#elif __TIZEN__
- char *app_id = (char *)malloc(PATH_MAX_SIZE * sizeof(char));
- char completePath[PATH_MAX_SIZE];
+ char *app_id = NULL;
int res = app_get_id(&app_id);
if (APP_ERROR_NONE == res)
{
- strcpy(completePath, "/opt/usr/apps/");
- strcat(completePath, app_id);
- strcat(completePath, "/lib");
+ path = "/opt/usr/apps/";
+ path += app_id;
+ path += "/lib";
}
- path = completePath;
+ free(app_id);
#endif
if (loadConfigFile(path + "/pluginmanager.xml") != PM_S_OK)