From 6490f79f787f1dec7bc4927ca78c638493ede7e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 6 Apr 2008 10:36:41 +0000 Subject: [PATCH] CheckMemoryLeak: Added more allocation and deallocation functions --- CheckMemoryLeak.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CheckMemoryLeak.cpp b/CheckMemoryLeak.cpp index 5bc6989e0..07ddd6bd0 100644 --- a/CheckMemoryLeak.cpp +++ b/CheckMemoryLeak.cpp @@ -38,7 +38,14 @@ static AllocType GetAllocationType( const TOKEN *tok2 ) return No; // Does tok2 point on "malloc", "strdup" or "kmalloc".. - const char *mallocfunc[] = {"malloc", "strdup", "kmalloc", 0}; + const char *mallocfunc[] = {"malloc", + "calloc", + "realloc", + "strdup", + "kmalloc", + "kzalloc", + "g_malloc", + 0}; for ( unsigned int i = 0; mallocfunc[i]; i++ ) { if ( strcmp(mallocfunc[i], tok2->str) == 0 ) @@ -63,7 +70,8 @@ static AllocType GetDeallocationType( const TOKEN *tok, const char *varnames[] ) return NewA; if ( Match(tok, "free ( %var1% ) ;", varnames) || - Match(tok, "kfree ( %var1% ) ;", varnames) ) + Match(tok, "kfree ( %var1% ) ;", varnames) || + Match(tok, "g_free ( %var1% ) ;", varnames) ) { return Malloc; }