mirror of
https://github.com/chris2511/xca.git
synced 2026-09-12 19:51:05 +05:00
Replace malloc/free by new/delete
This commit is contained in:
parent
31088b608c
commit
7a5936eb9f
@ -136,8 +136,8 @@ int arguments::parse(int argc, char *argv[])
|
||||
|
||||
/* Setup "struct option" */
|
||||
if (!long_opts)
|
||||
long_opts = (struct option*)calloc(cnt +1,
|
||||
sizeof(*long_opts));
|
||||
long_opts = new struct option[cnt];
|
||||
|
||||
check_oom(long_opts);
|
||||
for (i = 0; i < cnt; ++i)
|
||||
opts[i].fillOption(long_opts +i);
|
||||
@ -190,8 +190,7 @@ arguments &arguments::operator = (const arguments &a)
|
||||
|
||||
arguments::~arguments()
|
||||
{
|
||||
if (long_opts)
|
||||
free(long_opts);
|
||||
delete long_opts;
|
||||
}
|
||||
|
||||
QString arguments::operator [] (const QString &key) const
|
||||
|
||||
@ -126,8 +126,7 @@ static const QList<int> other_curve_nids()
|
||||
builtin_curves::builtin_curves()
|
||||
{
|
||||
int i, num_curves = EC_get_builtin_curves(NULL, 0);
|
||||
EC_builtin_curve *curves = (EC_builtin_curve*)OPENSSL_malloc(
|
||||
(int)(sizeof(EC_builtin_curve) *num_curves));
|
||||
EC_builtin_curve *curves = new EC_builtin_curve[num_curves];
|
||||
|
||||
check_oom(curves);
|
||||
|
||||
@ -174,6 +173,7 @@ builtin_curves::builtin_curves()
|
||||
EC_GROUP_free(group);
|
||||
}
|
||||
BN_free(order);
|
||||
delete curves;
|
||||
}
|
||||
#else
|
||||
builtin_curves::builtin_curves() { }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user