main: automatically cleanup newpath

this was already the assumption in the source code.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2024-02-06 10:21:50 +01:00
parent 18f4d6768a
commit c08211ddd7
No known key found for this signature in database
GPG Key ID: 67E38F7A8BA21772

2
main.c
View File

@ -1092,7 +1092,7 @@ direct_renameat2 (int olddirfd, const char *oldpath,
static int
hide_node (struct ovl_data *lo, struct ovl_node *node, bool unlink_src)
{
char *newpath = NULL;
cleanup_free char *newpath = NULL;
int ret;
ret = asprintf (&newpath, "%lu", get_next_wd_counter ());