summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/objects/obj_dat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/objects/obj_dat.c')
-rw-r--r--src/lib/libcrypto/objects/obj_dat.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/lib/libcrypto/objects/obj_dat.c b/src/lib/libcrypto/objects/obj_dat.c
index bced796e62..641a97c8aa 100644
--- a/src/lib/libcrypto/objects/obj_dat.c
+++ b/src/lib/libcrypto/objects/obj_dat.c
@@ -199,7 +199,7 @@ static void cleanup3_doall(ADDED_OBJ *a)
199 { 199 {
200 if (--a->obj->nid == 0) 200 if (--a->obj->nid == 0)
201 ASN1_OBJECT_free(a->obj); 201 ASN1_OBJECT_free(a->obj);
202 OPENSSL_free(a); 202 free(a);
203 } 203 }
204 204
205static IMPLEMENT_LHASH_DOALL_FN(cleanup1, ADDED_OBJ) 205static IMPLEMENT_LHASH_DOALL_FN(cleanup1, ADDED_OBJ)
@@ -253,13 +253,13 @@ int OBJ_add_object(const ASN1_OBJECT *obj)
253 if (added == NULL) 253 if (added == NULL)
254 if (!init_added()) return(0); 254 if (!init_added()) return(0);
255 if ((o=OBJ_dup(obj)) == NULL) goto err; 255 if ((o=OBJ_dup(obj)) == NULL) goto err;
256 if (!(ao[ADDED_NID]=(ADDED_OBJ *)OPENSSL_malloc(sizeof(ADDED_OBJ)))) goto err2; 256 if (!(ao[ADDED_NID]=(ADDED_OBJ *)malloc(sizeof(ADDED_OBJ)))) goto err2;
257 if ((o->length != 0) && (obj->data != NULL)) 257 if ((o->length != 0) && (obj->data != NULL))
258 if (!(ao[ADDED_DATA]=(ADDED_OBJ *)OPENSSL_malloc(sizeof(ADDED_OBJ)))) goto err2; 258 if (!(ao[ADDED_DATA]=(ADDED_OBJ *)malloc(sizeof(ADDED_OBJ)))) goto err2;
259 if (o->sn != NULL) 259 if (o->sn != NULL)
260 if (!(ao[ADDED_SNAME]=(ADDED_OBJ *)OPENSSL_malloc(sizeof(ADDED_OBJ)))) goto err2; 260 if (!(ao[ADDED_SNAME]=(ADDED_OBJ *)malloc(sizeof(ADDED_OBJ)))) goto err2;
261 if (o->ln != NULL) 261 if (o->ln != NULL)
262 if (!(ao[ADDED_LNAME]=(ADDED_OBJ *)OPENSSL_malloc(sizeof(ADDED_OBJ)))) goto err2; 262 if (!(ao[ADDED_LNAME]=(ADDED_OBJ *)malloc(sizeof(ADDED_OBJ)))) goto err2;
263 263
264 for (i=ADDED_DATA; i<=ADDED_NID; i++) 264 for (i=ADDED_DATA; i<=ADDED_NID; i++)
265 { 265 {
@@ -270,7 +270,7 @@ int OBJ_add_object(const ASN1_OBJECT *obj)
270 aop=lh_ADDED_OBJ_insert(added,ao[i]); 270 aop=lh_ADDED_OBJ_insert(added,ao[i]);
271 /* memory leak, buit should not normally matter */ 271 /* memory leak, buit should not normally matter */
272 if (aop != NULL) 272 if (aop != NULL)
273 OPENSSL_free(aop); 273 free(aop);
274 } 274 }
275 } 275 }
276 o->flags&= ~(ASN1_OBJECT_FLAG_DYNAMIC|ASN1_OBJECT_FLAG_DYNAMIC_STRINGS| 276 o->flags&= ~(ASN1_OBJECT_FLAG_DYNAMIC|ASN1_OBJECT_FLAG_DYNAMIC_STRINGS|
@@ -281,8 +281,8 @@ err2:
281 OBJerr(OBJ_F_OBJ_ADD_OBJECT,ERR_R_MALLOC_FAILURE); 281 OBJerr(OBJ_F_OBJ_ADD_OBJECT,ERR_R_MALLOC_FAILURE);
282err: 282err:
283 for (i=ADDED_DATA; i<=ADDED_NID; i++) 283 for (i=ADDED_DATA; i<=ADDED_NID; i++)
284 if (ao[i] != NULL) OPENSSL_free(ao[i]); 284 if (ao[i] != NULL) free(ao[i]);
285 if (o != NULL) OPENSSL_free(o); 285 if (o != NULL) free(o);
286 return(NID_undef); 286 return(NID_undef);
287 } 287 }
288 288
@@ -449,7 +449,7 @@ ASN1_OBJECT *OBJ_txt2obj(const char *s, int no_name)
449 /* Work out total size */ 449 /* Work out total size */
450 j = ASN1_object_size(0,i,V_ASN1_OBJECT); 450 j = ASN1_object_size(0,i,V_ASN1_OBJECT);
451 451
452 if((buf=(unsigned char *)OPENSSL_malloc(j)) == NULL) return NULL; 452 if((buf=(unsigned char *)malloc(j)) == NULL) return NULL;
453 453
454 p = buf; 454 p = buf;
455 /* Write out tag+length */ 455 /* Write out tag+length */
@@ -459,7 +459,7 @@ ASN1_OBJECT *OBJ_txt2obj(const char *s, int no_name)
459 459
460 cp=buf; 460 cp=buf;
461 op=d2i_ASN1_OBJECT(NULL,&cp,j); 461 op=d2i_ASN1_OBJECT(NULL,&cp,j);
462 OPENSSL_free(buf); 462 free(buf);
463 return op; 463 return op;
464 } 464 }
465 465
@@ -590,7 +590,7 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
590 } 590 }
591 n++; 591 n++;
592 n += i; 592 n += i;
593 OPENSSL_free(bndec); 593 free(bndec);
594 } 594 }
595 else 595 else
596 { 596 {
@@ -774,7 +774,7 @@ int OBJ_create(const char *oid, const char *sn, const char *ln)
774 i=a2d_ASN1_OBJECT(NULL,0,oid,-1); 774 i=a2d_ASN1_OBJECT(NULL,0,oid,-1);
775 if (i <= 0) return(0); 775 if (i <= 0) return(0);
776 776
777 if ((buf=(unsigned char *)OPENSSL_malloc(i)) == NULL) 777 if ((buf=(unsigned char *)malloc(i)) == NULL)
778 { 778 {
779 OBJerr(OBJ_F_OBJ_CREATE,ERR_R_MALLOC_FAILURE); 779 OBJerr(OBJ_F_OBJ_CREATE,ERR_R_MALLOC_FAILURE);
780 return(0); 780 return(0);
@@ -788,7 +788,7 @@ int OBJ_create(const char *oid, const char *sn, const char *ln)
788 ok=OBJ_add_object(op); 788 ok=OBJ_add_object(op);
789err: 789err:
790 ASN1_OBJECT_free(op); 790 ASN1_OBJECT_free(op);
791 OPENSSL_free(buf); 791 free(buf);
792 return(ok); 792 return(ok);
793 } 793 }
794 794