Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-04-11 Roland Dreier <rdreier@cisco.com>
+ * src/sysfs.c (ibv_read_sysfs_file): Fix memory leak if open fails.
+
* src/device.c (ibv_get_device_guid), src/verbs.c (ibv_query_gid,
ibv_query_pkey), src/init.c (init_drivers, check_abi_version): Use
libibverbs functions instead of libsysfs functions to get to sysfs.
asprintf(&path, "%s/%s", dir, file);
fd = open(path, O_RDONLY);
- if (fd < 0)
+ if (fd < 0) {
+ free(path);
return -1;
+ }
len = read(fd, buf, size);