]> git.openfabrics.org - ~shefty/libibverbs.git/commitdiff
Fix minor memory leaks
authorRoland Dreier <rolandd@cisco.com>
Thu, 1 Jun 2006 05:41:41 +0000 (05:41 +0000)
committerRoland Dreier <rolandd@cisco.com>
Thu, 9 Nov 2006 19:36:01 +0000 (11:36 -0800)
The result of asprintf needs to be free when no longer needed.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
ChangeLog
src/init.c

index 5ecacf159dcc234cba2b6cf88d01f35a6cce63ba..fe7c902323fa0b3107e702a8581377b33339537f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2006-05-31  Roland Dreier  <rdreier@cisco.com>
 
+       * src/init.c (find_drivers): Fix memory leak: the result of
+       asprintf() needs to be freed when we're done with it.
+
        * examples/asyncwatch.c (event_name_str): Print human-readable
        form of IBV_EVENT_CLIENT_REREGISTER.
 
index 1df5f17904f8532c3aa94abe42a86a9d04c323fe..04dfd9b23d7d1445b23afe201d93928325fc3ee2 100644 (file)
@@ -108,6 +108,8 @@ static void find_drivers(char *dir)
        asprintf(&pat, "%s/*.so", dir);
 
        ret = glob(pat, 0, NULL, &so_glob);
+       free(pat);
+
        if (ret) {
                if (ret != GLOB_NOMATCH)
                        fprintf(stderr, PFX "Warning: couldn't search %s\n", pat);