projects
/
binutils-gdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bfbfa6e
)
Fix a double free when re-allocating a buffer to size 0.
author
Nick Clifton
<nickc@redhat.com>
Fri, 30 Apr 2021 13:04:08 +0000
(14:04 +0100)
committer
Nick Clifton
<nickc@redhat.com>
Fri, 30 Apr 2021 13:04:08 +0000
(14:04 +0100)
PR 27797
* libbfd.c (bfd_realloc_or_free): Do not free a pointer than has
been realloc'ed to size 0.
bfd/ChangeLog
patch
|
blob
|
history
bfd/libbfd.c
patch
|
blob
|
history
diff --git
a/bfd/ChangeLog
b/bfd/ChangeLog
index cd904dac58630f0456ae6d9111ced52fafb5f9ad..548ed9f57d3cf31b26b8f2d7c77d28ff85331620 100644
(file)
--- a/
bfd/ChangeLog
+++ b/
bfd/ChangeLog
@@
-1,3
+1,9
@@
+2021-04-30 Nick Clifton <nickc@redhat.com>
+
+ PR 27797
+ * libbfd.c (bfd_realloc_or_free): Do not free a pointer than has
+ been realloc'ed to size 0.
+
2021-04-30 Nick Clifton <nickc@redhat.com>
PR 27795
diff --git
a/bfd/libbfd.c
b/bfd/libbfd.c
index 9db14c3c22fd071c03edb451a8052b47ace20f7f..52c924560b2de80a8ccaa6fcf1874f57a090f05b 100644
(file)
--- a/
bfd/libbfd.c
+++ b/
bfd/libbfd.c
@@
-312,7
+312,7
@@
bfd_realloc_or_free (void *ptr, bfd_size_type size)
{
void *ret = bfd_realloc (ptr, size);
- if (ret == NULL)
+ if (ret == NULL
&& size > 0
)
free (ptr);
return ret;