Merge svn revision 855 from Zebra repository.
diff --git a/ospf6d/ospf6_message.c b/ospf6d/ospf6_message.c
index 19ea2c7..71ff362 100644
--- a/ospf6d/ospf6_message.c
+++ b/ospf6d/ospf6_message.c
@@ -1119,6 +1119,10 @@
   sendnew = XMALLOC (MTYPE_OSPF6_MESSAGE, size);
   if (recvnew == NULL || sendnew == NULL)
     {
+      if (recvnew)
+        XFREE (MTYPE_OSPF6_MESSAGE, recvnew);
+      if (sendnew)
+        XFREE (MTYPE_OSPF6_MESSAGE, sendnew);
       zlog_info ("Could not allocate I/O buffer of size %d.", size);
       return iobuflen;
     }