diff options
author | Gilbert Ramirez <gram@alumni.rice.edu> | 2001-12-13 05:49:13 +0000 |
---|---|---|
committer | Gilbert Ramirez <gram@alumni.rice.edu> | 2001-12-13 05:49:13 +0000 |
commit | 82380ce2c471e66a13da0b27c4822a402ac7c44a (patch) | |
tree | ddd763c7f1f4fe84d5c47b08fca9b257cfd21c98 /wiretap/pppdump.c | |
parent | 7e092f2dd86c37089c98397e0d56bf45680fe4b5 (diff) |
Don't leak memory when closing a pppdump trace file.
The second argument to g_ptr_array_free() does not indicate to
glib to free the objects that the pointers in the GPtrArray refer to,
but simply whether or not the free the block of pointers. We have
to free the objects ourselves.
svn path=/trunk/; revision=4391
Diffstat (limited to 'wiretap/pppdump.c')
-rw-r--r-- | wiretap/pppdump.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/wiretap/pppdump.c b/wiretap/pppdump.c index 7f4b247783..1d2e371834 100644 --- a/wiretap/pppdump.c +++ b/wiretap/pppdump.c @@ -1,6 +1,6 @@ /* pppdump.c * - * $Id: pppdump.c,v 1.10 2001/11/13 23:55:44 gram Exp $ + * $Id: pppdump.c,v 1.11 2001/12/13 05:49:12 gram Exp $ * * Copyright (c) 2000 by Gilbert Ramirez <gram@alumni.rice.edu> * @@ -589,7 +589,11 @@ pppdump_close(wtap *wth) } if (state->pids) { /* should always be TRUE */ - g_ptr_array_free(state->pids, TRUE); /* free data, too */ + int i; + for (i = 0; i < g_ptr_array_len(state->pids); i++) { + g_free(g_ptr_array_index(state->pids, i)); + } + g_ptr_array_free(state->pids, TRUE); } g_free(state); |