Author: dcreager
Date: Sun May 20 14:05:09 2012
New Revision: 1340726
URL: http://svn.apache.org/viewvc?rev=1340726&view=rev
Log:
AVRO-1086. C: Fix possible crash bug in default codec initialization
Contributed by Pugachev Maxim.
Modified:
avro/trunk/CHANGES.txt
avro/trunk/lang/c/src/codec.c
Modified: avro/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/avro/trunk/CHANGES.txt?rev=1340726&r1=1340725&r2=1340726&view=diff
==============================================================================
--- avro/trunk/CHANGES.txt (original)
+++ avro/trunk/CHANGES.txt Sun May 20 14:05:09 2012
@@ -95,6 +95,9 @@ Avro 1.7.0 (unreleased)
AVRO-1083. C: Fix multiple memory leaks. (Pugachev Maxim via dcreager)
+ AVRO-1086. C: Fix possible crash bug in default codec initialization.
+ (Pugachev Maxim via dcreager)
+
Avro 1.6.3 (5 March 2012)
AVRO-1077. Missing 'inline' for union set function. (thiru)
Modified: avro/trunk/lang/c/src/codec.c
URL:
http://svn.apache.org/viewvc/avro/trunk/lang/c/src/codec.c?rev=1340726&r1=1340725&r2=1340726&view=diff
==============================================================================
--- avro/trunk/lang/c/src/codec.c (original)
+++ avro/trunk/lang/c/src/codec.c Sun May 20 14:05:09 2012
@@ -110,12 +110,14 @@ codec_deflate(avro_codec_t codec)
if (deflateInit2(ds, Z_BEST_COMPRESSION, Z_DEFLATED, -15, 8,
Z_DEFAULT_STRATEGY) != Z_OK) {
avro_freet(struct codec_data_deflate, codec->codec_data);
+ codec->codec_data = NULL;
avro_set_error("Cannot initialize zlib deflate");
return 1;
}
if (inflateInit2(is, -15) != Z_OK) {
avro_freet(struct codec_data_deflate, codec->codec_data);
+ codec->codec_data = NULL;
avro_set_error("Cannot initialize zlib inflate");
return 1;
}