parent_list() has instances where a handle is leaked, both by going
out of scope, and on error paths.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
static int
parent_list(int fullpath)
{
- void *handlep;
+ void *handlep = NULL;
size_t handlen;
int error, i;
int retval = 1;
progname, path, strerror(errno));
goto error;
}
+ free_handle(fshandle, fshlen);
}
if (path_to_handle(path, &handlep, &handlen) != 0) {
if (!parentbuf) {
fprintf(stderr, _("%s: unable to allocate parent buffer: %s\n"),
progname, strerror(errno));
- return 1;
+ goto error;
}
if (fullpath) {
retval = 0;
error:
+ free(handlep);
free(parentbuf);
return retval;
}