pgjdbc-ng icon indicating copy to clipboard operation
pgjdbc-ng copied to clipboard

Second and subsequent calls to free() on PGBuffersArray throw NPE rather than being no-op

Open JTEgan opened this issue 4 years ago • 0 comments

The PGBuffersArray class implements java.sql.Array, and the doc for the free() method in that interface states:

If free is called multiple times, the subsequent calls to free are treated as a no-op.

In the pgjdbc-ng implementation, the second call results in a NullPointerException:

java.lang.NullPointerException: null at com.impossibl.postgres.jdbc.PGBuffersArray.free(PGBuffersArray.java:294) at...

I have a small change to address the issue, will submit a PR shortly.

JTEgan avatar Sep 16 '21 20:09 JTEgan