Change-Id: I2a7c85ffa7eb5e3ddd99de2bc92bba7e3ae1be77
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
-/**
+/**
* \file pathutils.c
*
* Copyright (C) 2005-2008 Linus Walleij <triad@df.lth.se>
static uint32_t
lookup_folder_id (LIBMTP_folder_t * folder, char * path, char * parent)
{
- char * current;
+ char * current = NULL;
uint32_t ret = (uint32_t) -1;
if (strcmp(path,"/")==0)
}
current = malloc (strlen(parent) + strlen(folder->name) + 2);
+ if (current == NULL) {
+ printf("Memory allocation failure\n");
+ return ret;
+ }
snprintf(current,strlen(parent)+strlen(folder->name)+1,"%s/%s",parent,folder->name);
if (strcasecmp (path, current) == 0) {
free (current);