aboutsummaryrefslogtreecommitdiffstats
path: root/set_error_existing.c
blob: db6d6f1fb4668bba645d4890c502d7d91d9533a2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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);
		}
	}
}