Skip to content

valgrind complains about uninitialized memory #14

@romanbsd

Description

@romanbsd

The nodes are allocated with malloc and often not initialized.
I'm not sure that it's a real problem, but perhaps it's better to use calloc instead of malloc.

diff --git a/app/jni/rax_malloc.h b/app/jni/rax_malloc.h
index e9d5d5d7b..2ebe00665 100755
--- a/app/jni/rax_malloc.h
+++ b/app/jni/rax_malloc.h
@@ -37,7 +37,7 @@
 
 #ifndef RAX_ALLOC_H
 #define RAX_ALLOC_H
-#define rax_malloc malloc
+#define rax_malloc(s) calloc(1, s)
 #define rax_realloc realloc
 #define rax_free free
 #endif

If you want I can create a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions