torch / tds

Torch C data structures
Other
80 stars 25 forks source link

tds_vec: fix extra free(s) elements on remove #7

Closed deltheil closed 8 years ago

deltheil commented 8 years ago

tds_vec_remove must only decrement the vector size before returning. So do not call tds_vec_resize for that purpose since it frees up extra element(s).

I encountered this via a malloc: pointer being freed was not allocated error.

soumith commented 8 years ago

Thanks Cedric.