The local variable 'path' is not freed in cxl_port_init() for success case.
The patch fixes that.

Signed-off-by: Shivaprasad G Bhat <[email protected]>
---
 cxl/lib/libcxl.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/cxl/lib/libcxl.c b/cxl/lib/libcxl.c
index be6bc2c..e52896f 100644
--- a/cxl/lib/libcxl.c
+++ b/cxl/lib/libcxl.c
@@ -770,6 +770,7 @@ static int cxl_port_init(struct cxl_port *port, struct 
cxl_port *parent_port,
        if (sysfs_read_attr(ctx, path, buf) == 0)
                port->module = util_modalias_to_module(ctx, buf);
 
+       free(path);
        return 0;
 err:
        free(port->dev_path);



Reply via email to