Message ID | 20220304000133.1053883-1-alison.schofield@intel.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 057ca6fc2ce63625236bf00e795e0847e6508ed8 |
Headers | show |
Series | [ndctl] libdaxctl: free resource allocated with asprintf() | expand |
diff --git a/daxctl/lib/libdaxctl.c b/daxctl/lib/libdaxctl.c index f173bbb7c514..5703992f5b88 100644 --- a/daxctl/lib/libdaxctl.c +++ b/daxctl/lib/libdaxctl.c @@ -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,