[RTEMS Project] #2881: src/cpukit/libnetworking/libc/res_mkupdate.c:395]: (error) Memory leak: rrecp

RTEMS trac trac at rtems.org
Mon Jan 23 17:59:55 UTC 2017


#2881: src/cpukit/libnetworking/libc/res_mkupdate.c:395]: (error) Memory leak:
rrecp
---------------------+------------------
 Reporter:  dcb      |      Owner:
     Type:  defect   |     Status:  new
 Priority:  lowest   |  Milestone:  4.12
Component:  General  |    Version:  4.11
 Severity:  normal   |   Keywords:
---------------------+------------------
 Source code is

     ns_updrec *rrecp = (ns_updrec *)calloc(1, sizeof(ns_updrec));

     if (!rrecp || !(rrecp->r_dname = strdup(dname)))
         return (NULL);

 If the calloc succeeds and the strdup fails, then leak.

--
Ticket URL: <http://devel.rtems.org/ticket/2881>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list