]> git.puffer.fish Git - mirror/frr.git/commitdiff
2004-12-21 Paul Jakma <paul.jakma@sun.com>
authorpaul <paul>
Wed, 22 Dec 2004 00:15:34 +0000 (00:15 +0000)
committerpaul <paul>
Wed, 22 Dec 2004 00:15:34 +0000 (00:15 +0000)
* stream.c: Dont allocate streams with 0 sized data buffers

lib/ChangeLog
lib/stream.c

index 065cddd0cfecedd7c7d74b368766b4e9241d928e..07eb21d1c558d1287c5c41758250559c6f6f7234 100644 (file)
@@ -2,6 +2,7 @@
 
        * if.h: Add more 'non-generic' IFF_ flags.
        * if.c: IFF_NOXMIT/IFF_VIRTUAL interfaces are 'loopback like'
+       * stream.c: Dont allocate streams with 0 sized data buffers
 
 2004-12-17 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
 
index 2d4de760bd46f8e352b02a2b0f6d0ebadd11bef0..1b85b130d30e0c95d309bbc2c5d41143f7a50d99 100644 (file)
@@ -46,6 +46,11 @@ stream_new (size_t size)
 {
   struct stream *s;
 
+  assert (size > 0);
+  
+  if (size == 0)
+    return NULL;
+  
   s = XCALLOC (MTYPE_STREAM, sizeof (struct stream));
 
   s->data = XCALLOC (MTYPE_STREAM_DATA, size);