> > ... or, in other words, try to fix most memory leak upon failure. > > This kind of change is difficult to test, the more eyes reviewing it, > > the better. > > Well, I'll try to take a stab at it then.
> You might be able to use ASN1_STRING_set(ret, NULL, len) to handle > resizing / allocating the string the same way that it's used in > ASN1_TIME_to_generalizedtime(). Alternately, you might want to at least > use 'p = realloc(ret->data, len)' instead of malloc + free. I'm trying to stick to the existing logic and only plug the memory leaks here. Code factoring can happen as a later diff (in other words: I'm writing this down on the list). > Looks like there's a bit of an oversight here -- ret isn't referred to > after this point in the function. Oops, you're right. I'll send an updated diff this evening. Miod