mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
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>
|
||
|---|---|---|
| .. | ||
| compel | ||
| exhaustive | ||
| inhfd | ||
| javaTests | ||
| jenkins | ||
| others | ||
| pki | ||
| zdtm | ||
| .gitignore | ||
| abrt.sh | ||
| check_actions.py | ||
| crit-recode.py | ||
| empty-netns-prep.sh | ||
| groups.desc | ||
| inhfd.desc | ||
| Makefile | ||
| pycriu | ||
| show_action.sh | ||
| umount2.c | ||
| zdtm.desc | ||
| zdtm.py | ||
| zdtm_ct.c | ||
| zdtm_mount_cgroups | ||
| zdtm_umount_cgroups | ||