Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

Wwwxxx.APC, wwwxxx CN2, can't locate feature.pm in @inc (@inc contains, Wwwxxx ba2, wwwxxx Bhaskar, wwwxxx Bhaskar, XxxxDup, wwwxxix Buzz, wwwxxxdbgf, ncurses font size

Links

XODOX
Impressum

#1: [mdadm PATCH] Fix small memory leak

Posted on 2011-10-02 21:45:41 by Thomas Jarosch

Credit goes to cppcheck.

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
---
policy.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/policy.c b/policy.c
index 2bbbac8..4a6ef82 100644
--- a/policy.c
+++ b/policy.c
@@ -757,8 +757,10 @@ int policy_check_path(struct mdinfo *disk, struct map_ent *array)

snprintf(path, PATH_MAX, FAILED_SLOTS_DIR "/%s", id_path);
f = fopen(path, "r");
- if (!f)
+ if (!f) {
+ free(id_path);
return 0;
+ }

rv = fscanf(f, " %s %x:%x:%x:%x\n",
array->metadata,
@@ -767,6 +769,7 @@ int policy_check_path(struct mdinfo *disk, struct map_ent *array)
array->uuid+2,
array->uuid+3);
fclose(f);
+ free(id_path);
return rv == 5;
}

--
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Report this message

#2: Re: [mdadm PATCH] Fix small memory leak

Posted on 2011-10-02 23:31:27 by NeilBrown

--Sig_/J8fyedvHsN7D2dhjWDGRl.s
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

On Sun, 02 Oct 2011 21:45:41 +0200 Thomas Jarosch
<thomas.jarosch@intra2net.com> wrote:

> Credit goes to cppcheck.
>=20
> Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
> ---
> policy.c | 5 ++++-
> 1 files changed, 4 insertions(+), 1 deletions(-)
>=20
> diff --git a/policy.c b/policy.c
> index 2bbbac8..4a6ef82 100644
> --- a/policy.c
> +++ b/policy.c
> @@ -757,8 +757,10 @@ int policy_check_path(struct mdinfo *disk, struct ma=
p_ent *array)
> =20
> snprintf(path, PATH_MAX, FAILED_SLOTS_DIR "/%s", id_path);
> f =3D fopen(path, "r");
> - if (!f)
> + if (!f) {
> + free(id_path);
> return 0;
> + }
> =20
> rv =3D fscanf(f, " %s %x:%x:%x:%x\n",
> array->metadata,
> @@ -767,6 +769,7 @@ int policy_check_path(struct mdinfo *disk, struct map=
_ent *array)
> array->uuid+2,
> array->uuid+3);
> fclose(f);
> + free(id_path);
> return rv == 5;
> }
> =20


applied. Thanks.

NeilBrown

--Sig_/J8fyedvHsN7D2dhjWDGRl.s
Content-Type: application/pgp-signature; name=signature.asc
Content-Disposition: attachment; filename=signature.asc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (GNU/Linux)

iD8DBQFOiNgvG5fc6gV+Wb0RAjKlAKCrUdwnh+B5gNKomblesz9c5XNt3gCf aD4t
5dweZ+sWis0HPWrPjMkFuzo=
=dNVl
-----END PGP SIGNATURE-----

--Sig_/J8fyedvHsN7D2dhjWDGRl.s--
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Report this message