CQN notification objects are not freed correctly, causing segmentation faults · Issue #96 · oracle/odpi (original) (raw)

@K900

The code responsible for freeing CQN message objects contains a typo that causes occasional segfaults, use-after-frees, memory leaks and other related weirdness:

dpiSubscr.cpp, line 279:

for (j = 0; j < query->numTables; j++) {
    if (query->tables[i].numRows > 0)
        dpiUtils__freeMemory(query->tables[i].rows);
}

The code erroneously uses i as a counter for freeing tables, where it should be j.