On Sun, 25 May 2014 12:24:17 -0700
Philip Guenther <[email protected]> wrote:
> Just say no to casting the return value of malloc/calloc/realloc!

I understand.
fixed.

Index: src/crypto/store/str_lib.c
===================================================================
RCS file: /cvs/src/lib/libssl/src/crypto/store/str_lib.c,v
retrieving revision 1.4
diff -u -p -r1.4 str_lib.c
--- src/crypto/store/str_lib.c  17 Apr 2014 21:32:37 -0000      1.4
+++ src/crypto/store/str_lib.c  25 May 2014 21:38:47 -0000
@@ -1185,10 +1185,9 @@ int STORE_delete_arbitrary(STORE *s, OPE
 
 STORE_OBJECT *STORE_OBJECT_new(void)
        {
-       STORE_OBJECT *object = malloc(sizeof(STORE_OBJECT));
-       if (object) memset(object, 0, sizeof(STORE_OBJECT));
-       return object;
+       return calloc(1, sizeof(STORE_OBJECT));
        }
+
 void STORE_OBJECT_free(STORE_OBJECT *data)
        {
        if (!data) return;





Reply via email to