summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--utils/imxtools/misc.c3
-rw-r--r--utils/imxtools/misc.h2
2 files changed, 3 insertions, 2 deletions
diff --git a/utils/imxtools/misc.c b/utils/imxtools/misc.c
index 8d7cea89d7..7271ca8ab7 100644
--- a/utils/imxtools/misc.c
+++ b/utils/imxtools/misc.c
@@ -30,7 +30,7 @@ bool g_debug = false;
* Misc
*/
-void *memdup(void *p, size_t len)
+void *memdup(const void *p, size_t len)
{
void *cpy = xmalloc(len);
memcpy(cpy, p, len);
@@ -156,6 +156,7 @@ void clear_keys()
{
free(g_key_array);
g_nr_keys = 0;
+ g_key_array = NULL;
}
void add_keys_from_file(const char *key_file)
diff --git a/utils/imxtools/misc.h b/utils/imxtools/misc.h
index b0b7dfeba6..7ff9ce545a 100644
--- a/utils/imxtools/misc.h
+++ b/utils/imxtools/misc.h
@@ -38,7 +38,7 @@ typedef struct crypto_key_t *key_array_t;
int g_nr_keys;
key_array_t g_key_array;
-void *memdup(void *p, size_t len);
+void *memdup(const void *p, size_t len);
void *augment_array(void *arr, size_t elem_sz, size_t cnt, void *aug, size_t aug_cnt);
void generate_random_data(void *buf, size_t sz);
void *xmalloc(size_t s);