--- old/src/share/native/java/util/zip/Inflater.c 2010-11-22 14:26:41.245443780 -0800 +++ new/src/share/native/java/util/zip/Inflater.c 2010-11-22 14:26:40.980120798 -0800 @@ -135,7 +135,8 @@ in_buf = (jbyte *) malloc(in_len); if (in_buf == 0) { - JNU_ThrowOutOfMemoryError(env, 0); + if (in_len != 0) + JNU_ThrowOutOfMemoryError(env, 0); return 0; } (*env)->GetByteArrayRegion(env, this_buf, this_off, in_len, in_buf); @@ -143,7 +144,8 @@ out_buf = (jbyte *) malloc(len); if (out_buf == 0) { free(in_buf); - JNU_ThrowOutOfMemoryError(env, 0); + if (len != 0) + JNU_ThrowOutOfMemoryError(env, 0); return 0; }