summaryrefslogtreecommitdiff
path: root/components/dfs
diff options
context:
space:
mode:
authorRogerz Zhang <[email protected]>2013-04-01 19:06:22 +0800
committerRogerz Zhang <[email protected]>2013-04-01 19:06:22 +0800
commit489b3822f04878737eb0736a123ef7e1fa21e58c (patch)
tree226b28a3a8d67558431f509b8db55e5d26a8773d /components/dfs
parent158e9cdf9132e1d51c526f103d31eb07e56adace (diff)
parentd781e564606ab40184612bacf0a0bfa5dc094400 (diff)
Merge remote-tracking branch 'official/master' into auto-ci
Diffstat (limited to 'components/dfs')
-rw-r--r--components/dfs/src/dfs.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/components/dfs/src/dfs.c b/components/dfs/src/dfs.c
index bcef0973b3..fc4d4f847b 100644
--- a/components/dfs/src/dfs.c
+++ b/components/dfs/src/dfs.c
@@ -304,6 +304,9 @@ char *dfs_normalize_path(const char *directory, const char *filename)
{
fullpath = rt_malloc(strlen(directory) + strlen(filename) + 2);
+ if (fullpath == RT_NULL)
+ return RT_NULL;
+
/* join path and file name */
rt_snprintf(fullpath, strlen(directory) + strlen(filename) + 2,
"%s/%s", directory, filename);
@@ -311,6 +314,9 @@ char *dfs_normalize_path(const char *directory, const char *filename)
else
{
fullpath = rt_strdup(filename); /* copy string */
+
+ if (fullpath == RT_NULL)
+ return RT_NULL;
}
src = fullpath;