aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalph Campbell <ralphc@pathscale.com>2006-03-06 21:17:48 +0000
committerRoland Dreier <rolandd@cisco.com>2006-11-09 11:35:59 -0800
commit7faed69501b3464fb51a318a6d09ac4dc24c9d6b (patch)
tree12e18687a0452bd68d90b175ce24483411c1e8a8
parent9d832611670a312d064e1c7bee232568e82d6d5b (diff)
downloadlibibverbs-7faed69501b3464fb51a318a6d09ac4dc24c9d6b.tar.gz
Fix memory leak in find_drivers()
I was browsing through the libibverbs code and found a minor memory leak. Here is the fix. Signed-off-by: Ralph Campbell <ralphc@pathscale.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r--ChangeLog5
-rw-r--r--src/init.c2
2 files changed, 7 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index a7d17cf..6ebcc88 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-03-06 Ralph Campbell <ralphc@pathscale.com>
+
+ * src/init.c (find_drivers): Fix minor memory leak: call
+ globfree() to free memory allocated by glob().
+
2006-02-23 Dotan Barak <dotanb@mellanox.co.il>
* src/cmd.c (ibv_cmd_create_srq): Add support for kernel ABI
diff --git a/src/init.c b/src/init.c
index 8a85ab3..91e3a96 100644
--- a/src/init.c
+++ b/src/init.c
@@ -111,6 +111,8 @@ static void find_drivers(char *dir)
for (i = 0; i < so_glob.gl_pathc; ++i)
load_driver(so_glob.gl_pathv[i]);
+
+ globfree(&so_glob);
}
static struct ibv_device *init_drivers(struct sysfs_class_device *verbs_dev)