summaryrefslogtreecommitdiff
path: root/rdoff/collectn.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2017-04-17 13:52:19 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2017-04-17 13:56:50 -0700
commit8dc965347ddf9caabacc4ca0441efe3a4ec32af8 (patch)
tree39c561c38dab93e90d70a82a1c6180e1571a15c1 /rdoff/collectn.c
parent74fa0a736ab769dd07ebe3c98b7e94543b558134 (diff)
downloadnasm-8dc965347ddf9caabacc4ca0441efe3a4ec32af8.tar.gz
rdoff: use nasm-provided safe memory allocation and I/O
We already have abort-on-error memory allocation and I/O operations in nasmlib, so use them for rdoff as well. Delete long-since-obsolete rdoff Mkfiles directory. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'rdoff/collectn.c')
-rw-r--r--rdoff/collectn.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/rdoff/collectn.c b/rdoff/collectn.c
index 317c5286..d77f54b5 100644
--- a/rdoff/collectn.c
+++ b/rdoff/collectn.c
@@ -4,8 +4,7 @@
* This file is public domain.
*/
-#include "compiler.h"
-#include <stdlib.h>
+#include "rdfutils.h"
#include "collectn.h"
void collection_init(Collection * c)
@@ -22,7 +21,7 @@ void **colln(Collection * c, int index)
while (index >= 32) {
index -= 32;
if (c->next == NULL) {
- c->next = malloc(sizeof(Collection));
+ c->next = nasm_malloc(sizeof(Collection));
collection_init(c->next);
}
c = c->next;
@@ -36,7 +35,7 @@ void collection_reset(Collection * c)
if (c->next) {
collection_reset(c->next);
- free(c->next);
+ nasm_free(c->next);
}
c->next = NULL;