mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-07 21:23:12 +02:00
Fix two small memory leaks in extjwt (sfilename, b64sig) and change another
one (extjwt_hash_val) to just a simply safe_free() as well which is less error prone (just needs the value to be initialized to NULL at the beginning but that is already done).
This commit is contained in:
@@ -596,6 +596,7 @@ int extjwt_configtest(ConfigFile *cf, ConfigEntry *ce, int type, int *errs)
|
||||
extjwt_free_services(&services);
|
||||
if (errors)
|
||||
safe_free(cfg_state.key_filename);
|
||||
safe_free(sfilename);
|
||||
return errors ? -1 : 1;
|
||||
}
|
||||
|
||||
@@ -1141,15 +1142,11 @@ char *extjwt_generate_token(const char *payload, struct extjwt_config *config)
|
||||
safe_free(header);
|
||||
safe_free(b64header);
|
||||
safe_free(b64payload);
|
||||
if (config->method != EXTJWT_METHOD_NONE)
|
||||
{
|
||||
safe_free(b64sig);
|
||||
safe_free(extjwt_hash_val);
|
||||
}
|
||||
safe_free(b64sig);
|
||||
safe_free(extjwt_hash_val);
|
||||
|
||||
if (retval != b64data)
|
||||
safe_free(b64data);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user