librazor/error.c
changeset 501 850be6a6885c
parent 455 df914f383f5c
     1.1 --- a/librazor/error.c	Thu Oct 09 17:27:41 2014 +0100
     1.2 +++ b/librazor/error.c	Fri Jun 08 18:02:49 2018 +0100
     1.3 @@ -42,6 +42,30 @@
     1.4  	return error->code;
     1.5  }
     1.6  
     1.7 +void
     1.8 +razor_error_set_object(struct razor_error *error, const char *object)
     1.9 +{
    1.10 +	if (!error)
    1.11 +		return;
    1.12 +
    1.13 +	free(error->object);
    1.14 +
    1.15 +	if (object)
    1.16 +		error->object = strdup(object);
    1.17 +	else
    1.18 +		error->object = NULL;
    1.19 +
    1.20 +	if (error->obj_str) {
    1.21 +		free(error->obj_str);
    1.22 +		error->obj_str = NULL;
    1.23 +	}
    1.24 +
    1.25 +	if (error->msg) {
    1.26 +		free(error->msg);
    1.27 +		error->msg = NULL;
    1.28 +	}
    1.29 +}
    1.30 +
    1.31  RAZOR_EXPORT const char *
    1.32  razor_error_get_object(struct razor_error *error)
    1.33  {