Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
autofs.c:66:17: error: pointer 'str' may be used after 'realloc' [-Werror=use-after-free] autofs.c: In function 'check_automount': ../lib/zdtmtst.h:131:9: error: pointer 'mountpoint' may be used after 'free' [-Werror=use-after-free] 131 | test_msg("ERR: %s:%d: " format " (errno = %d (%s))\n", __FILE__, __LINE__, ##arg, errno, strerror(errno)) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ autofs.c:277:17: note: in expansion of macro 'pr_perror' 277 | pr_perror("%s: failed to close fd %d", mountpoint, p->fd); | ^~~~~~~~~ autofs.c:268:9: note: call to 'free' here 268 | free(mountpoint); | ^~~~~~~~~~~~~~~~ Fixes: #1731 v2: (@Snorch) always update `str` after successful realloc() Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
- Loading branch information