diff --git a/libr/core/cmd_anal.c b/libr/core/cmd_anal.c index 93427036b0..c0df6429b6 100644 --- a/libr/core/cmd_anal.c +++ b/libr/core/cmd_anal.c @@ -8912,6 +8912,7 @@ R_API void cmd_agfb3(RCore *core, const char *s, int x, int y) { RConsPixel *p = r_cons_pixel_new (w, h); r_cons_pixel_sets (p, 0, 0, s); r_cons_pixel_flush (p, x, y); + R_FREE (p); } R_API void cmd_agfb2(RCore *core, const char *s) { diff --git a/libr/core/core.c b/libr/core/core.c index e38259d25f..2083666bab 100644 --- a/libr/core/core.c +++ b/libr/core/core.c @@ -3580,7 +3580,7 @@ reaccept: // silly http emulation over rap:// char line[256] = {0}; r_socket_read_block (c, (ut8*)line, sizeof (line)); - if (!strncmp (line, "ET /cmd/", 8)) { + if (!r_str_ncpy (line, "ET /cmd/", 8)) { char *cmd = line + 8; char *http = strstr (cmd, "HTTP"); if (http) { diff --git a/libr/hash/state.c b/libr/hash/state.c index 8af5054d1a..6f3ae6b4c6 100644 --- a/libr/hash/state.c +++ b/libr/hash/state.c @@ -1,6 +1,7 @@ /* radare - LGPL - Copyright 2009-2017 pancake */ #include +#include #if HAVE_LIB_SSL #include @@ -52,7 +53,7 @@ R_API ut8 *r_hash_do_ssdeep(RHash *ctx, const ut8 *input, int len) { } char *res = r_hash_ssdeep (input, len); if (res) { - strncpy ((char *)ctx->digest, res, R_HASH_SIZE_SSDEEP); + r_str_ncpy ((char *)ctx->digest, res, R_HASH_SIZE_SSDEEP); free (res); } return ctx->digest; diff --git a/libr/socket/run.c b/libr/socket/run.c index d8f813bf7c..c811b3879d 100644 --- a/libr/socket/run.c +++ b/libr/socket/run.c @@ -96,6 +96,7 @@ static void dyn_init(void) { if (!dyn_forkpty) { dyn_forkpty = r_lib_dl_sym (libutil, "forkpty"); } + R_FREE (libutil); } #endif }