aboutsummaryrefslogtreecommitdiff
path: root/src/exhaustive/arg.c
blob: 2c6c6ddaec14ca4c80af0a128c60f319fb3699b6 (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-2018 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;
	}
}