2007-02-10 02:14:24

by Brian Behlendorf

[permalink] [raw]
Subject: e2fsprogs coverity patch <cid-17.diff>

Lawrence Livermore National Labs recently ran the source code
analysis tool Coverity over the e2fsprogs-1.39 source to see
if it would identify any significant bugs. The analysis
turned up 38 mostly minor issues which are enumerated here
with patches. We went through and resolved these issues
but would love to see these mostly minor changes reviewed
and commited upstream.

Brian Behlendorf <[email protected]>, and
Herb Wartens <[email protected]>

Coverity ID: 17: Resource Leak

Need to free memory allocated to buf.

Index: e2fsprogs+chaos/lib/e2p/mntopts.c
--- e2fsprogs+chaos.orig/lib/e2p/mntopts.c
+++ e2fsprogs+chaos/lib/e2p/mntopts.c
@@ -132,5 +132,6 @@ int e2p_edit_mntopts(const char *str, __
*mntopts |= mask;
cp = next ? next+1 : 0;
+ free(buf);
return 0;