aboutsummaryrefslogtreecommitdiff
path: root/src/exhaustive/arg.c
blob: ba963578c04117a4b9b8990d066e589b12df8918 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*
 * ecgen, tool for generating Elliptic curve domain parameters
 * Copyright (C) 2017 J08nY
 */
#include "arg.h"
#include "util/memory.h"

arg_t *arg_new(void) { return try_calloc(sizeof(arg_t)); }

void arg_free(arg_t **arg) {
	if (*arg) {
		if ((*arg)->allocd) {
			try_free((*arg)->allocd);
			(*arg)->allocd = NULL;
		}
		try_free(*arg);
		*arg = NULL;
	}
}