aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrelan <relan@users.noreply.github.com>2014-05-23 19:24:13 +0000
committerrelan <relan@users.noreply.github.com>2015-08-24 08:26:16 +0300
commit7f46abf86d25e38d19f3b653ac3fa0fecd6e0e0a (patch)
tree2e3de5b8537daba0cabadebf4bc4647263a13517
parent9568e2b89b7c3dd4caa6a52a2d7a7a331b07022b (diff)
downloadandroid_external_exfat-7f46abf86d25e38d19f3b653ac3fa0fecd6e0e0a.tar.gz
android_external_exfat-7f46abf86d25e38d19f3b653ac3fa0fecd6e0e0a.tar.bz2
android_external_exfat-7f46abf86d25e38d19f3b653ac3fa0fecd6e0e0a.zip
Fix memory leak on realloc() failure.
In fact reallocf() would do the thing but unfortunetly it's non-standard.
-rw-r--r--fuse/main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fuse/main.c b/fuse/main.c
index b9b412a..2f157c4 100644
--- a/fuse/main.c
+++ b/fuse/main.c
@@ -379,6 +379,7 @@ static struct fuse_operations fuse_exfat_ops =
static char* add_option(char* options, const char* name, const char* value)
{
size_t size;
+ char* optionsf = options;
if (value)
size = strlen(options) + strlen(name) + strlen(value) + 3;
@@ -388,6 +389,7 @@ static char* add_option(char* options, const char* name, const char* value)
options = realloc(options, size);
if (options == NULL)
{
+ free(optionsf);
exfat_error("failed to reallocate options string");
return NULL;
}