diff options
author | fcolin | 2005-08-19 13:44:02 +0000 |
---|---|---|
committer | fcolin | 2005-08-19 13:44:02 +0000 |
commit | 0461197d573f0d38c3ce2c7e6ba55cb8c5727d42 (patch) | |
tree | 04d59a93302e2fce6c498adfa5f5415d4ba22b0e /src/ivy.c | |
parent | 9921017a4b14b379d99305e17f8583ff90de0c1b (diff) | |
download | ivy-c-0461197d573f0d38c3ce2c7e6ba55cb8c5727d42.zip ivy-c-0461197d573f0d38c3ce2c7e6ba55cb8c5727d42.tar.gz ivy-c-0461197d573f0d38c3ce2c7e6ba55cb8c5727d42.tar.bz2 ivy-c-0461197d573f0d38c3ce2c7e6ba55cb8c5727d42.tar.xz |
correction bug malloc free
Diffstat (limited to 'src/ivy.c')
-rw-r--r-- | src/ivy.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -524,8 +524,8 @@ static char* Receive( Client client, void *data, char *message, unsigned int len const char *errbuf; IvyBindingGetCompileError( &offset, &errbuf ); MsgSendTo( client, Error, offset, strlen(errbuf), errbuf ); + free( str_regexp ); } - free( str_regexp ); break; case DelBinding: @@ -1074,8 +1074,8 @@ int IvySendMsg(const char *fmt, ...) { IvyClientPtr clnt; int match_count = 0; - static char *buffer = NULL; /* Use satic mem to eliminate multiple call to malloc /free */ - static int size = 0; /* donc non reentrant !!!! */ + char *buffer = NULL; /* Use satic mem to eliminate multiple call to malloc /free */ + int size = 0; /* donc non reentrant !!!! */ va_list ap; va_start( ap, fmt ); @@ -1089,19 +1089,21 @@ int IvySendMsg(const char *fmt, ...) #ifdef DEBUG if ( match_count == 0 ) printf( "Warning no recipient for %s\n",buffer); #endif + free(buffer); return match_count; } void IvySendError( IvyClientPtr app, int id, const char *fmt, ... ) { - static char *buffer = NULL; /* Use satic mem to eliminate multiple call to malloc /free */ - static int size = 0; /* donc non reentrant !!!! */ + char *buffer = NULL; /* Use satic mem to eliminate multiple call to malloc /free */ + int size = 0; /* donc non reentrant !!!! */ va_list ap; va_start( ap, fmt ); make_message( &buffer, &size, 0, fmt, ap ); va_end ( ap ); MsgSendTo( app->client, Error, id, strlen(buffer), buffer); + free(buffer); } void IvyBindDirectMsg( MsgDirectCallback callback, void *user_data) |