forked from len0rd/rockbox
imxtools: add const and set pointer to NULL on free to avoid double free
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30918 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
ae601954aa
commit
ad9e280281
2 changed files with 3 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue