isobusfs: srv: free handle path when closing the handle

The path of an opened file or directory handle is allocated with
strdup() but was not freed when the handle got closed. Every open/close
sequence leaked the path string.

Free the path before clearing the handle.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
This commit is contained in:
Oliver Hartkopp
2026-10-14 10:21:56 +00:00
parent 1a90b9a75d
commit 3a980d83e0
+1
View File
@@ -159,6 +159,7 @@ static int isobusfs_srv_release_handle(struct isobusfs_srv_priv *priv,
closedir(hdl->dir);
else
close(hdl->fd);
free(hdl->path);
memset(hdl, 0, sizeof(*hdl));
priv->handles_count--;
}