antirez / antirez/rax

valgrind complains about uninitialized memory

Đang mở
#14 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
C
Star
1.3k
Fork
177
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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.
```patch
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.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.