avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dcrea...@apache.org
Subject svn commit: r1352853 - in /avro/trunk: CHANGES.txt lang/c/src/codec.c lang/c/src/datafile.c
Date Fri, 22 Jun 2012 11:54:02 GMT
Author: dcreager
Date: Fri Jun 22 11:54:01 2012
New Revision: 1352853

URL: http://svn.apache.org/viewvc?rev=1352853&view=rev
Log:
AVRO-1115. C: Fix crash error in codec cleanup code.

Contributed by Maxim Pugachev.

Modified:
    avro/trunk/CHANGES.txt
    avro/trunk/lang/c/src/codec.c
    avro/trunk/lang/c/src/datafile.c

Modified: avro/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/avro/trunk/CHANGES.txt?rev=1352853&r1=1352852&r2=1352853&view=diff
==============================================================================
--- avro/trunk/CHANGES.txt (original)
+++ avro/trunk/CHANGES.txt Fri Jun 22 11:54:01 2012
@@ -27,6 +27,9 @@ Avro 1.7.1 (unreleased)
 
     AVRO-1069. Java: Fix HttpTransceiver to close streams. (cutting)
 
+    AVRO-1115. C: Fix crash error in codec cleanup code. (Maxim Pugachev via
+    dcreager)
+
 Avro 1.7.0 (11 June 2012)
 
   NEW FEATURES

Modified: avro/trunk/lang/c/src/codec.c
URL: http://svn.apache.org/viewvc/avro/trunk/lang/c/src/codec.c?rev=1352853&r1=1352852&r2=1352853&view=diff
==============================================================================
--- avro/trunk/lang/c/src/codec.c (original)
+++ avro/trunk/lang/c/src/codec.c Fri Jun 22 11:54:01 2012
@@ -390,6 +390,10 @@ static int reset_lzma(avro_codec_t c)
 
 int avro_codec(avro_codec_t codec, const char *type)
 {
+	if (type == NULL) {
+		return codec_null(codec);
+	}
+
 #ifdef DEFLATE_CODEC
 	if (strcmp("deflate", type) == 0) {
 		return codec_deflate(codec);

Modified: avro/trunk/lang/c/src/datafile.c
URL: http://svn.apache.org/viewvc/avro/trunk/lang/c/src/datafile.c?rev=1352853&r1=1352852&r2=1352853&view=diff
==============================================================================
--- avro/trunk/lang/c/src/datafile.c (original)
+++ avro/trunk/lang/c/src/datafile.c Fri Jun 22 11:54:01 2012
@@ -404,6 +404,7 @@ int avro_file_writer_open(const char *pa
 		avro_freet(struct avro_file_writer_t_, w);
 		return ENOMEM;
 	}
+	avro_codec(w->codec, NULL);
 	rval = file_writer_open(path, w);
 	if (rval) {
 		avro_codec_reset(w->codec);
@@ -482,6 +483,7 @@ int avro_file_reader_fp(FILE *fp, const 
 		avro_freet(struct avro_file_reader_t_, r);
 		return ENOMEM;
 	}
+	avro_codec(r->codec, NULL);
 
 	rval = file_read_header(r->reader, &r->writers_schema, r->codec,
 				r->sync, sizeof(r->sync));



Mime
View raw message