Free color in r_cons_pal_init()

This commit is contained in:
Lazula 2022-02-18 06:23:11 -06:00 committed by pancake
parent 5165f0c7ba
commit 3de3c43ec6

View File

@ -155,16 +155,17 @@ static void __cons_pal_update_event(RConsContext *ctx) {
static R_TH_LOCAL RThreadLock *lock = NULL;
R_API void r_cons_pal_init(RConsContext *ctx) {
size_t i;
if (!lock) {
lock = r_th_lock_new (false);
}
r_th_lock_enter (lock);
memset (&ctx->cpal, 0, sizeof (ctx->cpal));
// r_cons_pal_free (ctx);
size_t i;
for (i = 0; keys[i].name; i++) {
char **color = (char **) (((ut8 *) &(ctx->pal)) + keys[i].off);
*color = NULL;
if (color && *color) {
R_FREE (*color);
}
}
ctx->cpal.b0x00 = (RColor) RColor_GREEN;