+2007-06-29 Michael Snyder <msnyder@svkmacdonelllnx>
+
+ * bfd.c (bfd_demangle): Plug memory leak (Coverity).
+
2007-06-29 M R Swami Reddy <MR.Swami.Reddy@nsc.com>
* Makefile.am: Add cr16 related entry
suf = res + len;
suf_len = strlen (suf) + 1;
final = bfd_malloc (pre_len + len + suf_len);
- if (final == NULL)
- return NULL;
-
- memcpy (final, pre, pre_len);
- memcpy (final + pre_len, res, len);
- memcpy (final + pre_len + len, suf, suf_len);
+ if (final != NULL)
+ {
+ memcpy (final, pre, pre_len);
+ memcpy (final + pre_len, res, len);
+ memcpy (final + pre_len + len, suf, suf_len);
+ }
free (res);
res = final;
}