Raised This Month: $51 Target: $400
 12% 

Memory leaks in several engine functions


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sbeaman
Junior Member
Join Date: Apr 2004
Old 04-15-2004 , 15:20   Memory leaks in several engine functions
Reply With Quote #1

I posted this on bug tracker on source forge but since it was the only bug in there and it appears the bug tracking system may not yet be fully configured I am posting here just in case.

Looking at the source of release 0.16 it appears several functions will leak memory everytime they are called. All functions that use AMX_GET_STRING should be checked.

The issue is AMX_GET_STRING returns a dynamically allocated char pointer. If this pointer is not stored in a data structure it should be freed. Several function in engine/meta_api.cpp never free the pointer returned by AMX_GET_STRING. The following function will leak memory every time called:

find_ent_by_target
register_message
find_ent_by_model
find_ent_by_tname
set_lights

Other routines use AMX_GET_STRING but at first glance I could not determine if they leaked memory since they are passing data structures to the engine.
sbeaman is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:17.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode