diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2012-03-07 14:44:46 +0100 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2012-03-08 08:09:56 -0500 |
commit | bd72b3510105599b5bdaf00c203df1164b304238 (patch) | |
tree | 05d2518aa8c287c20c312a621de95c2a5c5ca83b /src/sss_client/autofs | |
parent | 1c383994ae898fa862f93c43501395bae6304f28 (diff) | |
download | sssd-bd72b3510105599b5bdaf00c203df1164b304238.tar.gz sssd-bd72b3510105599b5bdaf00c203df1164b304238.tar.bz2 sssd-bd72b3510105599b5bdaf00c203df1164b304238.zip |
Only free returned values on success
https://fedorahosted.org/sssd/ticket/1237
Diffstat (limited to 'src/sss_client/autofs')
-rw-r--r-- | src/sss_client/autofs/autofs_test_client.c | 6 |
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 6e95c174..386c890c 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); |