summaryrefslogtreecommitdiff
path: root/src/ivy.c
diff options
context:
space:
mode:
authorfcolin2005-08-19 13:44:02 +0000
committerfcolin2005-08-19 13:44:02 +0000
commit0461197d573f0d38c3ce2c7e6ba55cb8c5727d42 (patch)
tree04d59a93302e2fce6c498adfa5f5415d4ba22b0e /src/ivy.c
parent9921017a4b14b379d99305e17f8583ff90de0c1b (diff)
downloadivy-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.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/ivy.c b/src/ivy.c
index d4b4880..b1777fe 100644
--- a/src/ivy.c
+++ b/src/ivy.c
@@ -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)