From 7f46abf86d25e38d19f3b653ac3fa0fecd6e0e0a Mon Sep 17 00:00:00 2001 From: relan Date: Fri, 23 May 2014 19:24:13 +0000 Subject: [PATCH] Fix memory leak on realloc() failure. In fact reallocf() would do the thing but unfortunetly it's non-standard. --- fuse/main.c | 2 ++ 1 file changed, 2 insertions(+) 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; } -- 2.11.0