Fix incorrect assignation, and fix memleak ( since new_sd is allocated a...

...nd never used )