antirez / antirez/rax

valgrind complains about uninitialized memory

オープン
#14 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
C
スター
1.3k
フォーク
177
PR マージ指標
30日以内にマージされた PR はありません

説明

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.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。