3992 mdb ::stacks segv
authorJosef 'Jeff' Sipek <jeffpc@josefsipek.net>
Mon, 05 Aug 2013 15:59:45 -0400
changeset 14202 d6c78587e290
parent 14201 6437867d550b
child 14203 e9e346400fef
3992 mdb ::stacks segv Reviewed by: Jason King <[email protected]> Reviewed by: Robert Mustacchi <[email protected]> Approved by: Robert Mustacchi <[email protected]>
usr/src/cmd/mdb/common/modules/genunix/findstack.c
--- a/usr/src/cmd/mdb/common/modules/genunix/findstack.c	Fri Aug 02 15:33:09 2013 -0400
+++ b/usr/src/cmd/mdb/common/modules/genunix/findstack.c	Mon Aug 05 15:59:45 2013 -0400
@@ -21,6 +21,7 @@
 
 /*
  * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, Josef 'Jeff' Sipek <[email protected]>
  */
 
 #include <mdb/mdb_modapi.h>
@@ -340,6 +341,8 @@
 			mdb_free(stacks_array,
 			    stacks_array_size * sizeof (*stacks_array));
 
+		mdb_free(stacks_hash, STACKS_HSIZE * sizeof (*stacks_hash));
+
 	} else if (stacks_array != NULL) {
 		for (idx = 0; idx < stacks_array_size; idx++) {
 			if ((cur = stacks_array[idx]) != NULL) {
@@ -360,6 +363,8 @@
 
 	stacks_array_size = 0;
 	stacks_state = STACKS_STATE_CLEAN;
+	stacks_hash = NULL;
+	stacks_array = NULL;
 }
 
 /*ARGSUSED*/