aboutsummaryrefslogtreecommitdiffstats
path: root/set_error_existing.c
diff options
context:
space:
mode:
Diffstat (limited to 'set_error_existing.c')
-rw-r--r--set_error_existing.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/set_error_existing.c b/set_error_existing.c
new file mode 100644
index 0000000..db6d6f1
--- /dev/null
+++ b/set_error_existing.c
@@ -0,0 +1,17 @@
+/* See LICENSE file for copyright and license details. */
+#include "internal.h"
+
+
+void
+liberror_set_error_existing(struct liberror_error *error)
+{
+ liberror_reset_error();
+ if (error) {
+ liberror_have_error_ = 1;
+ memcpy(&liberror_error_, error, sizeof(*error));
+ if (error->dynamically_allocated) {
+ liberror_error_.dynamically_allocated = 0;
+ free(error);
+ }
+ }
+}