summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/reallocf.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdlib/reallocf.c')
-rw-r--r--lib/libc/stdlib/reallocf.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/libc/stdlib/reallocf.c b/lib/libc/stdlib/reallocf.c
new file mode 100644
index 0000000..728acc9
--- /dev/null
+++ b/lib/libc/stdlib/reallocf.c
@@ -0,0 +1,12 @@
+#include <stdlib.h>
+
+void *
+reallocf(void *ptr, size_t size)
+{
+ void *nptr;
+
+ nptr = realloc(ptr, size);
+ if (!nptr && ptr)
+ free(ptr);
+ return (nptr);
+}
OpenPOWER on IntegriCloud