Skip Menu |

Subject: Memory leak cleanup in ASN.1
The following five commits to the trunk were involved in cleaning up a
slew of memory leaks in the ASN.1 code:

r22004 (krb5_decode memory leaks)
r21981 (utility function fixes)
r21940 (krb5_decode restructuring)
r21928 (krb5_encode memory leaks)
r21927 (don't free caller memory in asn1_k_encode)
Subject: SVN Commit
Download (untitled) / with headers
text/plain 3.2KiB

pull up r21927, r21928, r21940, r21969, r21981, r22004 from trunk

r22004 | ghudson | 2009-02-13 17:05:48 -0500 (Fri, 13 Feb 2009) | 3 lines
Changed paths:
M /trunk/src/lib/krb5/asn.1/asn1_k_decode.c
M /trunk/src/lib/krb5/asn.1/asn1_k_decode.h
M /trunk/src/lib/krb5/asn.1/krb5_decode.c

Correct numerous memory leaks on error conditions in the ASN.1
decoder functions.

r21981 | ghudson | 2009-02-12 13:21:33 -0500 (Thu, 12 Feb 2009) | 4 lines
Changed paths:
M /trunk/src/lib/krb5/asn.1/asn1_encode.c
M /trunk/src/lib/krb5/asn.1/asn1buf.c

Modify asn12krb5_buf and asn1_do_full_encode to make output parameter
values well-defined on error. Clean up memory handling and an unused
variable in asn1_do_full_encode.

r21969 | ghudson | 2009-02-11 15:18:43 -0500 (Wed, 11 Feb 2009) | 6 lines
Changed paths:
M /trunk/src/include/k5-int.h
M /trunk/src/lib/krb5/krb/kfree.c
M /trunk/src/lib/krb5/libkrb5.exports

Ensure we have a free function for every data type we have an ASN.1
decoder for. Export the new free functions, but only declare them
in k5-int.h since they shouldn't be needed by applications. Also
export a couple of encoder and decoder functions not previously

r21940 | ghudson | 2009-02-09 21:01:58 -0500 (Mon, 09 Feb 2009) | 5 lines
Changed paths:
M /trunk/src/lib/krb5/asn.1/krb5_decode.c

Adjust the structure of krb5_decode.c functions to initialize output
parameters to NULL and not set them to the real values until a
successful return is guaranteed. Also fix get_eoc which was returning
without clean_return.

r21928 | ghudson | 2009-02-09 16:25:53 -0500 (Mon, 09 Feb 2009) | 4 lines
Changed paths:
M /trunk/src/lib/krb5/asn.1/asn1buf.c
M /trunk/src/lib/krb5/asn.1/asn1buf.h
M /trunk/src/lib/krb5/asn.1/krb5_encode.c

Make asn1buf_destroy return void, since it's a free function. In
krb5_encode.c functions, make *code well-defined in case of error,
and clean up some memory leaks.

r21927 | ghudson | 2009-02-09 16:23:00 -0500 (Mon, 09 Feb 2009) | 3 lines
Changed paths:
M /trunk/src/lib/krb5/asn.1/asn1_k_encode.c

In asn1_k_encode.c, stop inconsistently destroying buf on some errors.
It belongs to the caller.
Commit By: tlyu
Revision: 22207
Changed Files:
U branches/krb5-1-7/src/include/k5-int.h
U branches/krb5-1-7/src/lib/krb5/asn.1/asn1_encode.c
U branches/krb5-1-7/src/lib/krb5/asn.1/asn1_k_decode.c
U branches/krb5-1-7/src/lib/krb5/asn.1/asn1_k_decode.h
U branches/krb5-1-7/src/lib/krb5/asn.1/asn1_k_encode.c
U branches/krb5-1-7/src/lib/krb5/asn.1/asn1buf.c
U branches/krb5-1-7/src/lib/krb5/asn.1/asn1buf.h
U branches/krb5-1-7/src/lib/krb5/asn.1/krb5_decode.c
U branches/krb5-1-7/src/lib/krb5/asn.1/krb5_encode.c
U branches/krb5-1-7/src/lib/krb5/krb/kfree.c
U branches/krb5-1-7/src/lib/krb5/libkrb5.exports