lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #20478] memp_malloc returns bogus value on malloc fail


From: Simon Goldschmidt
Subject: [lwip-devel] [bug #20478] memp_malloc returns bogus value on malloc failure
Date: Sat, 14 Jul 2007 17:15:18 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4

Follow-up Comment #13, bug #20478 (project lwip):

It would be even better to have the memp += MEM_SIZE inside the body of
if(memp!=NULL). That way we totally save redundant code:

...
  if (memp != NULL) {    
    memp_tab[type] = memp->next;    
#if MEMP_OVERFLOW_CHECK
    memp->next = NULL;
    memp->file = file;
    memp->line = line;
#endif /* MEMP_OVERFLOW_CHECK */
#if MEMP_STATS
...
#endif /* MEMP_STATS */
    LWIP_ASSERT(...);
    memp = (struct memp*)((u8_t*)memp + MEMP_SIZE);
  } else {
    LWIP_DEBUGF(...);
#if MEMP_STATS
...
#endif /* MEMP_STATS */
  }

  SYS_ARCH_UNPROTECT(old_level);

  return memp;
}

OK?

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?20478>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.nongnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]