summaryrefslogtreecommitdiff
path: root/lib/int.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/int.h')
-rw-r--r--lib/int.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/int.h b/lib/int.h
index 322b80f..a3e890d 100644
--- a/lib/int.h
+++ b/lib/int.h
@@ -197,4 +197,20 @@ convert_old_type (unsigned int ntype)
return ntype;
}
+static inline
+void *_asn1_realloc(void *ptr, size_t size)
+{
+ void *ret;
+
+ if (size == 0)
+ return ptr;
+
+ ret = realloc(ptr, size);
+ if (ret == NULL)
+ {
+ free(ptr);
+ }
+ return ret;
+}
+
#endif /* INT_H */