angleto / liblinear

BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

use std::vector for managing temporary memory #4

Open simsong opened 6 years ago

simsong commented 6 years ago

From @larsmans on August 1, 2014 9:23

This plugs a lot of potential memory leaks: if, in

double *p = new double[n];
double *q = new double[n];

the second allocation fails, the result of the first is not automatically cleaned up. With vectors, the cleanup is automatic.

Copied from original issue: cjlin1/liblinear/pull/4