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


arg_t *arg_new() {
	arg_t *arg = pari_malloc(sizeof(arg_t));
	if (!arg) {
		perror("Couldn't malloc.");
		exit(1);
	}
	memset(arg, 0, sizeof(arg_t));
	return arg;
}

void arg_free(arg_t **arg) {
	if (*arg) {
		pari_free(*arg);
		*arg = NULL;
	}
}