dl: avoid closing NULL