aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/asn1/a_object.c
diff options
context:
space:
mode:
authorBen Laurie <ben@openssl.org>1999-04-17 21:25:43 +0000
committerBen Laurie <ben@openssl.org>1999-04-17 21:25:43 +0000
commite778802f53c8d47e96a6e4cbc776eb6e1d4c461a (patch)
tree719d4dd0fc69b355c6d8329af1f90b2c4f603548 /crypto/asn1/a_object.c
parentd77b3054cd87c2b13fa0169931f74b8e0dac5252 (diff)
downloadopenssl-e778802f53c8d47e96a6e4cbc776eb6e1d4c461a.tar.gz
Massive constification.
Diffstat (limited to 'crypto/asn1/a_object.c')
-rw-r--r--crypto/asn1/a_object.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/crypto/asn1/a_object.c b/crypto/asn1/a_object.c
index a476960d9a..9eff09509c 100644
--- a/crypto/asn1/a_object.c
+++ b/crypto/asn1/a_object.c
@@ -90,11 +90,12 @@ unsigned char **pp;
int a2d_ASN1_OBJECT(out,olen,buf,num)
unsigned char *out;
int olen;
-char *buf;
+const char *buf;
int num;
{
int i,first,len=0,c;
- char tmp[24],*p;
+ char tmp[24];
+ const char *p;
unsigned long l;
if (num == 0)
@@ -188,7 +189,7 @@ ASN1_OBJECT *a;
int i,idx=0,n=0,len,nid;
unsigned long l;
unsigned char *p;
- char *s;
+ const char *s;
char tbuf[32];
if (buf_len <= 0) return(0);
@@ -246,9 +247,9 @@ ASN1_OBJECT *a;
}
else
{
- s=(char *)OBJ_nid2ln(nid);
+ s=OBJ_nid2ln(nid);
if (s == NULL)
- s=(char *)OBJ_nid2sn(nid);
+ s=OBJ_nid2sn(nid);
strncpy(buf,s,buf_len);
n=strlen(s);
}
@@ -355,8 +356,10 @@ ASN1_OBJECT *a;
if (a == NULL) return;
if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_STRINGS)
{
- if (a->sn != NULL) Free(a->sn);
- if (a->ln != NULL) Free(a->ln);
+#ifndef CONST_STRICT /* disable purely for compile-time strict const checking. Doing this on a "real" compile will cause mempory leaks */
+ if (a->sn != NULL) Free((void *)a->sn);
+ if (a->ln != NULL) Free((void *)a->ln);
+#endif
a->sn=a->ln=NULL;
}
if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_DATA)
@@ -366,7 +369,7 @@ ASN1_OBJECT *a;
a->length=0;
}
if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC)
- Free((char *)a);
+ Free(a);
}
ASN1_OBJECT *ASN1_OBJECT_create(nid,data,len,sn,ln)