diff options
author | Lukas Slebodnik <lslebodn@redhat.com> | 2014-05-27 14:53:11 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2014-05-27 21:16:16 +0200 |
commit | 01f0d708fddfd50bdbb36a63737dcdc2c2fbd28d (patch) | |
tree | d82db56a3a4afd8a3f71f22a766e7d5e1a80a4c5 /src/sss_client/autofs | |
parent | 71bcdde36bcfd8cb797777062208a85bf6337dec (diff) | |
download | sssd-01f0d708fddfd50bdbb36a63737dcdc2c2fbd28d.tar.gz sssd-01f0d708fddfd50bdbb36a63737dcdc2c2fbd28d.tar.xz sssd-01f0d708fddfd50bdbb36a63737dcdc2c2fbd28d.zip |
sss_autofs: Do not try to free empty autofs context
If initialisation fails in function _sss_setautomntent, context will not be
initialized and automount client will crash.
The function _sss_endautomntent should not try to dereference NULL pointer.
Resolves:
https://fedorahosted.org/sssd/ticket/2288
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Diffstat (limited to 'src/sss_client/autofs')
-rw-r--r-- | src/sss_client/autofs/sss_autofs.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/sss_client/autofs/sss_autofs.c b/src/sss_client/autofs/sss_autofs.c index 787b9f2b5..02f91ab2b 100644 --- a/src/sss_client/autofs/sss_autofs.c +++ b/src/sss_client/autofs/sss_autofs.c @@ -459,8 +459,10 @@ _sss_endautomntent(void **context) fctx = (struct automtent *) *context; - free(fctx->mapname); - free(fctx); + if (fctx != NULL) { + free(fctx->mapname); + free(fctx); + } ret = sss_autofs_make_request(SSS_AUTOFS_ENDAUTOMNTENT, NULL, NULL, NULL, &errnop); |