int olen = 0;
ut8 *obuf = r_muta_session_get_output (core->charset_session, &olen);
if (olen < 1) {
+ free (obuf);
*out = NULL;
core->charset_session->output_len = 0;
return 0;
}
ut8 *cpy = malloc (olen + 1);
if (!cpy) {
+ free (obuf);
*out = NULL;
core->charset_session->output_len = 0;
return 0;
}
memcpy (cpy, obuf, olen);
+ free (obuf);
cpy[olen] = 0;
*out = cpy;
core->charset_session->output_len = 0;
int olen = 0;
ut8 *obuf = r_muta_session_get_output (c->charset_session, &olen);
if (olen < 1) {
+ free (obuf);
*out = NULL;
c->charset_session->output_len = 0;
return 0;
}
ut8 *cpy = malloc (olen);
if (!cpy) {
+ free (obuf);
*out = NULL;
c->charset_session->output_len = 0;
return 0;
}
memcpy (cpy, obuf, olen);
+ free (obuf);
*out = cpy;
c->charset_session->output_len = 0;
return olen;
int olen = decode (cj, b + i, l - i, &out, &consumed);
if (olen > 0 && out) {
r_muta_session_append (cj, out, olen);
- free (out);
} else {
r_muta_session_append (cj, (const ut8 *)"?", 1);
}
+ free (out);
if (consumed < 1) {
consumed = 1;
}
int olen = decode (cj, b + i, l - i, &out, &consumed);
if (olen > 0 && out) {
r_muta_session_append (cj, out, olen);
- free (out);
}
+ free (out);
if (consumed < 1) {
consumed = 1;
}