summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2012-03-07 14:44:46 +0100
committerStephen Gallagher <sgallagh@redhat.com>2012-03-08 08:10:18 -0500
commitca2939f9291a92b2e0339cd888cecae88d6a09f5 (patch)
treec70bc3195663aecfa099488b41e289fe56f2db76 /src
parent04e0a138d63bd86abd2d819206a7044012e49a22 (diff)
downloadsssd-ca2939f9291a92b2e0339cd888cecae88d6a09f5.tar.gz
sssd-ca2939f9291a92b2e0339cd888cecae88d6a09f5.tar.xz
sssd-ca2939f9291a92b2e0339cd888cecae88d6a09f5.zip
Only free returned values on success
https://fedorahosted.org/sssd/ticket/1237
Diffstat (limited to 'src')
-rw-r--r--src/sss_client/autofs/autofs_test_client.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sss_client/autofs/autofs_test_client.c b/src/sss_client/autofs/autofs_test_client.c
index 6e95c1749..386c890c6 100644
--- a/src/sss_client/autofs/autofs_test_client.c
+++ b/src/sss_client/autofs/autofs_test_client.c
@@ -79,9 +79,9 @@ int main(int argc, const char *argv[])
ret = _sss_getautomntent_r(&key, &value, ctx);
if (ret == 0) {
printf("key: %s\t\tvalue: %s\n", key, value);
+ free(key);
+ free(value);
}
- free(key);
- free(value);
} while(ret == 0);
if (ret != 0 && ret != ENOENT) {
@@ -99,8 +99,8 @@ int main(int argc, const char *argv[])
exit(EXIT_FAILURE);
} else {
printf("key: %s\t\tvalue: %s\n", pc_key, value);
+ free(value);
}
- free(value);
}
ret = _sss_endautomntent(&ctx);