svn rev #21927: trunk/src/lib/krb5/asn.1/
ghudson@MIT.EDU
ghudson at MIT.EDU
Mon Feb 9 16:23:01 EST 2009
http://src.mit.edu/fisheye/changelog/krb5/?cs=21927
Commit By: ghudson
Log Message:
In asn1_k_encode.c, stop inconsistently destroying buf on some errors.
It belongs to the caller.
Changed Files:
U trunk/src/lib/krb5/asn.1/asn1_k_encode.c
Modified: trunk/src/lib/krb5/asn.1/asn1_k_encode.c
===================================================================
--- trunk/src/lib/krb5/asn.1/asn1_k_encode.c 2009-02-09 20:39:54 UTC (rev 21926)
+++ trunk/src/lib/krb5/asn.1/asn1_k_encode.c 2009-02-09 21:23:00 UTC (rev 21927)
@@ -1304,12 +1304,10 @@
{ unsigned int length; \
retval = encoder(buf,len,value,&length); \
if (retval) {\
- asn1buf_destroy(&buf);\
return retval; }\
sum += length;\
retval = asn1_make_etag(buf,CONTEXT_SPECIFIC,tag,length,&length);\
if (retval) {\
- asn1buf_destroy(&buf);\
return retval; }\
sum += length; }
@@ -1402,10 +1400,8 @@
if (val->parameters.length != 0) {
retval = asn1buf_insert_octetstring(buf, val->parameters.length,
val->parameters.data);
- if (retval) {
- asn1buf_destroy(&buf);
+ if (retval)
return retval;
- }
sum += val->parameters.length;
}
@@ -1415,10 +1411,8 @@
val->algorithm.data,
&length);
- if (retval) {
- asn1buf_destroy(&buf);
+ if (retval)
return retval;
- }
sum += length;
}
@@ -1440,20 +1434,16 @@
retval = asn1buf_insert_octetstring(buf, val->algorithm.parameters.length,
val->algorithm.parameters.data);
- if (retval) {
- asn1buf_destroy(&buf);
+ if (retval)
return retval;
- }
sum += val->algorithm.parameters.length;
retval = asn1_encode_oid(buf, val->algorithm.algorithm.length,
val->algorithm.algorithm.data,
&length);
- if (retval) {
- asn1buf_destroy(&buf);
+ if (retval)
return retval;
- }
sum += length;
@@ -1461,10 +1451,8 @@
val->algorithm.parameters.length + length,
&length);
- if (retval) {
- asn1buf_destroy(&buf);
+ if (retval)
return retval;
- }
sum += length;
}
@@ -1661,10 +1649,8 @@
retval = asn1_make_etag(buf, CONTEXT_SPECIFIC, 0,
val->subjectPublicKey.length + 1 + length,
&length);
- if (retval) {
- asn1buf_destroy(&buf);
+ if (retval)
return retval;
- }
sum += length;
}
@@ -1738,10 +1724,8 @@
{
unsigned int length;
retval = asn1_encode_sequence_of_external_principal_identifier(buf, val, &length);
- if (retval) {
- asn1buf_destroy(&buf);
+ if (retval)
return retval;
- }
/* length set but ignored? sum not updated? */
}
asn1_cleanup();
More information about the cvs-krb5
mailing list