Author: kib
Date: Fri Nov 18 09:56:40 2011
New Revision: 227661
URL: http://svn.freebsd.org/changeset/base/227661

Log:
  Free unused allocation on error.
  
  Reported by:  slonoman2011 yandex ru
  MFC after:    1 week

Modified:
  head/lib/librt/timer.c

Modified: head/lib/librt/timer.c
==============================================================================
--- head/lib/librt/timer.c      Fri Nov 18 09:55:47 2011        (r227660)
+++ head/lib/librt/timer.c      Fri Nov 18 09:56:40 2011        (r227661)
@@ -102,12 +102,14 @@ __timer_create(clockid_t clockid, struct
        }
 
        if (__sigev_check_init()) {
+               free(timer);
                errno = EINVAL;
                return (-1);
        }
 
        sn = __sigev_alloc(SI_TIMER, evp, NULL, 0);
        if (sn == NULL) {
+               free(timer);
                errno = EAGAIN;
                return (-1);
        }
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to