From a38722be2ba63466431616a0756981697d29fa23 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Mon, 18 Feb 2013 16:24:11 +0100 Subject: fuse_opt_parse(): fix memory leak when storing a newly allocated string for format "%s", free the previous value stored at that location. Reported by Marco Schuster --- include/fuse_opt.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/fuse_opt.h b/include/fuse_opt.h index add0a30..20653b1 100644 --- a/include/fuse_opt.h +++ b/include/fuse_opt.h @@ -70,8 +70,9 @@ extern "C" { * * 6) "-x %s", etc. Combination of 4) and 5) * - * If the format is "%s", memory is allocated for the string unlike - * with scanf(). + * If the format is "%s", memory is allocated for the string unlike with + * scanf(). The previous value (if non-NULL) stored at the this location is + * freed. */ struct fuse_opt { /** Matching template and optional parameter formatting */ -- cgit v1.2.3