gnunet-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-developers] Patch: init alloc'd mem to zero (pedantic defensive


From: january
Subject: [GNUnet-developers] Patch: init alloc'd mem to zero (pedantic defensive programming)
Date: Tue, 4 Feb 2003 09:32:06 -0800

Index: src/util/xmalloc.c
===================================================================
RCS file: /var/cvs/GNUnet/GNUnet/src/util/xmalloc.c,v
retrieving revision 1.32
diff -c -r1.32 xmalloc.c
*** src/util/xmalloc.c    25 Jan 2003 08:39:52 -0000    1.32
--- src/util/xmalloc.c    3 Feb 2003 22:04:24 -0000
***************
*** 36,42 ****
 
  /**
   * Allocate memory. Checks the return value, aborts if no more
!  * memory is available.
   **/
  void * xmalloc(int size,
             const char * site) {
--- 36,42 ----
 
  /**
   * Allocate memory. Checks the return value, aborts if no more
!  * memory is available.  The allocated memory is set to zero.
   **/
  void * xmalloc(int size,
             const char * site) {
***************
*** 58,63 ****
--- 58,64 ----
      errexit("ERROR: out of memory (%d at %s)!\n",
          size, site);
    }
+   memset(result, 0, size);
    return result;
  }





Concerned about your privacy? Follow this link to get
FREE encrypted email: https://www.hushmail.com/?l=2 

Big $$$ to be made with the HushMail Affiliate Program: 
https://www.hushmail.com/about.php?subloc=affiliate&l=427




reply via email to

[Prev in Thread] Current Thread [Next in Thread]