Fix incorrect assignation, and fix memleak ( since new_sd is allocated and never used )