sensord: add null check after malloc