From: Blue Swirl Date: Wed, 12 Jan 2011 19:48:58 +0000 (+0000) Subject: vvfat: fix a file descriptor leak X-Git-Tag: TizenStudio_2.0_p2.3~3670 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7288ee9bfff86814f377d3eba2281ec3c0ce6ef8;p=sdk%2Femulator%2Fqemu.git vvfat: fix a file descriptor leak Fix a file descriptor leak, reported by cppcheck: [/src/qemu/block/vvfat.c:759]: (error) Resource leak: dir Signed-off-by: Blue Swirl --- diff --git a/block/vvfat.c b/block/vvfat.c index 26dd474..fe568fe 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -756,6 +756,7 @@ static int read_directory(BDRVVVFATState* s, int mapping_index) if (st.st_size > 0x7fffffff) { fprintf(stderr, "File %s is larger than 2GB\n", buffer); free(buffer); + closedir(dir); return -2; } direntry->size=cpu_to_le32(S_ISDIR(st.st_mode)?0:st.st_size);