From 11668499632e3bdfec665e5d63818fbd788bbf7e Mon Sep 17 00:00:00 2001 From: Philippe Saint-Pierre Date: Sat, 8 Mar 2014 13:34:44 -0500 Subject: [PATCH] Hey: use delete[] instead of free (CID #990947 and CID #990948) --- src/bin/hey.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/hey.cpp b/src/bin/hey.cpp index 78e83977c2..0ab79684b8 100644 --- a/src/bin/hey.cpp +++ b/src/bin/hey.cpp @@ -928,7 +928,7 @@ print_message(BMessage *message) char *whatString = get_datatype_string(message->what); printf("BMessage(%s):\n", whatString); - free(whatString); + delete[] whatString; for (int32 i = 0; i < textlist.CountItems(); i++) { printf(" %s\n", (char*)textlist.ItemAt(i)); free(textlist.ItemAt(i)); @@ -1260,7 +1260,7 @@ format_data(int32 type, char *ptr, long size) if (anothermsg.Unflatten((const char *)ptr) == B_OK) { char *whatString = get_datatype_string(anothermsg.what); sprintf(str, "what=%s", whatString); - free(whatString); + delete[] whatString; } else strcpy(str, "error when unflattening"); break;