move the bndec variable in tighter since it's not used elsewhere in the
loop, then always free it after use.
ok bcook miod
-/* $OpenBSD: obj_dat.c,v 1.32 2015/10/14 21:02:08 beck Exp $ */
+/* $OpenBSD: obj_dat.c,v 1.33 2015/10/14 21:12:10 tedu Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
{
int i, ret = 0, len, nid, first = 1, use_bn;
BIGNUM *bl = NULL;
- char *bndec = NULL;
unsigned long l;
const unsigned char *p;
}
if (use_bn) {
+ char *bndec;
+
bndec = BN_bn2dec(bl);
if (!bndec)
goto err;
i = snprintf(buf, buf_len, ".%s", bndec);
+ free(bndec);
if (i == -1)
goto err;
if (i >= buf_len) {
}
out:
- free(bndec);
BN_free(bl);
return ret;
-/* $OpenBSD: obj_dat.c,v 1.32 2015/10/14 21:02:08 beck Exp $ */
+/* $OpenBSD: obj_dat.c,v 1.33 2015/10/14 21:12:10 tedu Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
{
int i, ret = 0, len, nid, first = 1, use_bn;
BIGNUM *bl = NULL;
- char *bndec = NULL;
unsigned long l;
const unsigned char *p;
}
if (use_bn) {
+ char *bndec;
+
bndec = BN_bn2dec(bl);
if (!bndec)
goto err;
i = snprintf(buf, buf_len, ".%s", bndec);
+ free(bndec);
if (i == -1)
goto err;
if (i >= buf_len) {
}
out:
- free(bndec);
BN_free(bl);
return ret;