ext/ox/dump.c in ox-1.2.5 vs ext/ox/dump.c in ox-1.2.6
- old
+ new
@@ -537,12 +537,11 @@
to_base64((u_char*)str, cnt, b64);
out->w_start(out, &e);
dump_value(out, b64, size);
e.indent = -1;
out->w_end(out, &e);
- // TBD pass in flag to free if failure
- if (sizeof(buf64) <= size) {
+ if (buf64 != b64) {
free(b64);
}
}
break;
}
@@ -675,10 +674,10 @@
rb_raise(rb_eNoMemError, "Failed to create string. [%d:%s]\n", ENOSPC, strerror(ENOSPC));
}
}
to_base64((u_char*)s, cnt, b64);
dump_value(out, b64, size);
- if (sizeof(buf64) <= size) {
+ if (buf64 != b64) {
free(b64);
}
}
#if 0
dump_value(out, "/", 1);