libdaxctl: free resource allocated with asprintf()
[email protected]
maintainerPATCH 1/1 libdaxctl: free resource allocated with asprintf()
From: Alison Schofield <[email protected]>
Static analysis reported this resource leak.
Fixes d07508a0cc3c ("libdaxctl: add daxctl_region_create_dev()")
Signed-off-by Alison Schofield <[email protected]>
--- daxctl/lib/libdaxctl.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
daxctl/lib/libdaxctl.c +2 -3
@@ -624,10 +624,9 @@ DAXCTL_EXPORT int daxctl_region_create_dev(struct daxctl_region *region) } rc =sysfs_write_attr (ctx, path, num_devices); -if (rc) -return rc; +free (num_devices); -return 0 ; +return rc; } DAXCTL_EXPORT int daxctl_region_destroy_dev(struct daxctl_region *region,
base-commit: 3b5fb8b6428dfaab39bab58d67412427f514c1f4
Signature · 1 line
2.31.1