aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--wiretap/pppdump.c8
-rw-r--r--wiretap/wtap-int.h7
2 files changed, 12 insertions, 3 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);
diff --git a/wiretap/wtap-int.h b/wiretap/wtap-int.h
index 2a7473600c..b52ee068e9 100644
--- a/wiretap/wtap-int.h
+++ b/wiretap/wtap-int.h
@@ -1,6 +1,6 @@
/* wtap-int.h
*
- * $Id: wtap-int.h,v 1.17 2001/12/04 08:26:00 guy Exp $
+ * $Id: wtap-int.h,v 1.18 2001/12/13 05:49:13 gram Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -347,4 +347,9 @@ struct wtap_dumper {
} \
G_STMT_END
+/* glib doesn't have g_ptr_array_len of all things!*/
+#ifndef g_ptr_array_len
+#define g_ptr_array_len(a) ((a)->len)
+#endif
+
#endif /* __WTAP_INT_H__ */