OSSP CVS Repository

ossp - Check-in [2540]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 2540
Date: 2002-Sep-22 09:35:40 (local)
2002-Sep-22 07:35:40 (UTC)
User:rse
Branch:
Comment: fix memory leak
Tickets:
Inspections:
Files:
ossp-pkg/l2/l2_ut_format.c      1.6 -> 1.7     3 inserted, 1 deleted

ossp-pkg/l2/l2_ut_format.c 1.6 -> 1.7

--- l2_ut_format.c       2002/07/30 19:08:25     1.6
+++ l2_ut_format.c       2002/09/22 07:35:40     1.7
@@ -1137,8 +1137,10 @@
     if ((s = malloc(rv+1)) == NULL)
         return NULL;
     ap = apbak;
-    if ((rv = l2_util_vsprintf(s, rv+1, fmt, ap)) == -1)
+    if ((rv = l2_util_vsprintf(s, rv+1, fmt, ap)) == -1) {
+        free(s);
         return NULL;
+    }
     return s;
 }
 

CVSTrac 2.0.1