1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-09 05:43:12 +02:00

Update cmode.free_param definition to fix memleak due to yesterdays commit.

And update release notes technical note so it actually refers to the
correct channel mode function :D
This commit is contained in:
Bram Matthys
2023-04-02 08:24:00 +02:00
parent 8ea50d38a3
commit b914997a1c
8 changed files with 23 additions and 20 deletions
+3 -3
View File
@@ -152,7 +152,7 @@ int cmodef_is_ok(Client *client, Channel *channel, char mode, const char *para,
void *cmodef_put_param(void *r_in, const char *param);
const char *cmodef_get_param(void *r_in);
const char *cmodef_conv_param(const char *param_in, Client *client, Channel *channel);
int cmodef_free_param(void *r);
int cmodef_free_param(void *r, int soft);
void *cmodef_dup_struct(void *r_in);
int cmodef_sjoin_check(Channel *channel, void *ourx, void *theirx);
int cmodef_profile_is_ok(Client *client, Channel *channel, char mode, const char *param, int type, int what);
@@ -879,14 +879,14 @@ const char *cmodef_conv_param(const char *param_in, Client *client, Channel *cha
return retbuf;
}
int cmodef_free_param(void *r)
int cmodef_free_param(void *r, int soft)
{
ChannelFloodProtection *fld = (ChannelFloodProtection *)r;
if (!fld)
return 0;
if (fld->profile && cfg.default_profile)
if (soft && fld->profile && cfg.default_profile)
{
/* Resist freeing */
if (strcmp(fld->profile, cfg.default_profile))
+2 -2
View File
@@ -50,7 +50,7 @@ int history_chanmode_is_ok(Client *client, Channel *channel, char mode, const ch
void *history_chanmode_put_param(void *r_in, const char *param);
const char *history_chanmode_get_param(void *r_in);
const char *history_chanmode_conv_param(const char *param, Client *client, Channel *channel);
int history_chanmode_free_param(void *r);
int history_chanmode_free_param(void *r, int soft);
void *history_chanmode_dup_struct(void *r_in);
int history_chanmode_sjoin_check(Channel *channel, void *ourx, void *theirx);
int history_channel_destroy(Channel *channel, int *should_destroy);
@@ -576,7 +576,7 @@ const char *history_chanmode_get_param(void *h_in)
}
/** Free channel mode */
int history_chanmode_free_param(void *r)
int history_chanmode_free_param(void *r, int soft)
{
safe_free(r);
return 0;
+2 -2
View File
@@ -45,7 +45,7 @@ int cmode_key_is_ok(Client *client, Channel *channel, char mode, const char *par
void *cmode_key_put_param(void *r_in, const char *param);
const char *cmode_key_get_param(void *r_in);
const char *cmode_key_conv_param(const char *param_in, Client *client, Channel *channel);
int cmode_key_free_param(void *r);
int cmode_key_free_param(void *r, int soft);
void *cmode_key_dup_struct(void *r_in);
int cmode_key_sjoin_check(Channel *channel, void *ourx, void *theirx);
int is_valid_key(const char *key);
@@ -162,7 +162,7 @@ const char *cmode_key_conv_param(const char *param, Client *client, Channel *cha
return retbuf;
}
int cmode_key_free_param(void *r)
int cmode_key_free_param(void *r, int soft)
{
safe_free(r);
return 0;
+2 -2
View File
@@ -48,7 +48,7 @@ int cmode_limit_is_ok(Client *client, Channel *channel, char mode, const char *p
void *cmode_limit_put_param(void *r_in, const char *param);
const char *cmode_limit_get_param(void *r_in);
const char *cmode_limit_conv_param(const char *param_in, Client *client, Channel *channel);
int cmode_limit_free_param(void *r);
int cmode_limit_free_param(void *r, int soft);
void *cmode_limit_dup_struct(void *r_in);
int cmode_limit_sjoin_check(Channel *channel, void *ourx, void *theirx);
int transform_channel_limit(const char *param);
@@ -159,7 +159,7 @@ const char *cmode_limit_conv_param(const char *param, Client *client, Channel *c
return retbuf;
}
int cmode_limit_free_param(void *r)
int cmode_limit_free_param(void *r, int soft)
{
safe_free(r);
return 0;
+2 -2
View File
@@ -49,7 +49,7 @@ int cmodeL_is_ok(Client *client, Channel *channel, char mode, const char *para,
void *cmodeL_put_param(void *r_in, const char *param);
const char *cmodeL_get_param(void *r_in);
const char *cmodeL_conv_param(const char *param_in, Client *client, Channel *channel);
int cmodeL_free_param(void *r);
int cmodeL_free_param(void *r, int soft);
void *cmodeL_dup_struct(void *r_in);
int cmodeL_sjoin_check(Channel *channel, void *ourx, void *theirx);
@@ -178,7 +178,7 @@ const char *cmodeL_conv_param(const char *param, Client *client, Channel *channe
return param;
}
int cmodeL_free_param(void *r)
int cmodeL_free_param(void *r, int soft)
{
safe_free(r);
return 0;