[fedfs-utils] [PATCH 7/9] libsi: don't leak a struct srvinfo upon failed strdup
Jim Meyering
jim at meyering.net
Thu Dec 1 07:58:24 PST 2011
From: Jim Meyering <meyering at redhat.com>
* src/libsi/getsrvinfo.c (getsrvinfo): Free "new".
Spotted by coverity.
Signed-off-by: Jim Meyering <meyering at redhat.com>
---
src/libsi/getsrvinfo.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/src/libsi/getsrvinfo.c b/src/libsi/getsrvinfo.c
index 7a465c7..931847e 100644
--- a/src/libsi/getsrvinfo.c
+++ b/src/libsi/getsrvinfo.c
@@ -289,6 +289,7 @@ getsrvinfo(const char *srvname, const char *domainname, struct srvinfo **si)
new->si_target = strdup(exp_dn);
if (new->si_target == NULL) {
+ free(new);
status = ESI_MEMORY;
goto out;
}
--
1.7.8.rc4
More information about the fedfs-utils-devel
mailing list