Replaced malloc and memset with calloc in nlsr.c