diff options
author | Ben Laurie <ben@openssl.org> | 1999-04-17 21:25:43 +0000 |
---|---|---|
committer | Ben Laurie <ben@openssl.org> | 1999-04-17 21:25:43 +0000 |
commit | e778802f53c8d47e96a6e4cbc776eb6e1d4c461a (patch) | |
tree | 719d4dd0fc69b355c6d8329af1f90b2c4f603548 /crypto/objects/obj_lib.c | |
parent | d77b3054cd87c2b13fa0169931f74b8e0dac5252 (diff) |
Massive constification.
Diffstat (limited to 'crypto/objects/obj_lib.c')
-rw-r--r-- | crypto/objects/obj_lib.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/crypto/objects/obj_lib.c b/crypto/objects/obj_lib.c index 16ff852095..ba30736dc7 100644 --- a/crypto/objects/obj_lib.c +++ b/crypto/objects/obj_lib.c @@ -67,18 +67,19 @@ ASN1_OBJECT *o; { ASN1_OBJECT *r; int i; + char *ln=NULL; if (o == NULL) return(NULL); if (!(o->flags & ASN1_OBJECT_FLAG_DYNAMIC)) return(o); - r=(ASN1_OBJECT *)ASN1_OBJECT_new(); + r=ASN1_OBJECT_new(); if (r == NULL) { OBJerr(OBJ_F_OBJ_DUP,ERR_R_ASN1_LIB); return(NULL); } - r->data=(unsigned char *)Malloc(o->length); + r->data=Malloc(o->length); if (r->data == NULL) goto err; memcpy(r->data,o->data,o->length); @@ -88,17 +89,19 @@ ASN1_OBJECT *o; if (o->ln != NULL) { i=strlen(o->ln)+1; - r->ln=(char *)Malloc(i); + r->ln=ln=Malloc(i); if (r->ln == NULL) goto err; - memcpy(r->ln,o->ln,i); + memcpy(ln,o->ln,i); } if (o->sn != NULL) { + char *s; + i=strlen(o->sn)+1; - r->sn=(char *)Malloc(i); + r->sn=s=Malloc(i); if (r->sn == NULL) goto err; - memcpy(r->sn,o->sn,i); + memcpy(s,o->sn,i); } r->flags=o->flags|(ASN1_OBJECT_FLAG_DYNAMIC| ASN1_OBJECT_FLAG_DYNAMIC_STRINGS|ASN1_OBJECT_FLAG_DYNAMIC_DATA); @@ -107,7 +110,7 @@ err: OBJerr(OBJ_F_OBJ_DUP,ERR_R_MALLOC_FAILURE); if (r != NULL) { - if (r->ln != NULL) Free(r->ln); + if (ln != NULL) Free(ln); if (r->data != NULL) Free(r->data); Free(r); } |