conncache.c: fix possible dereference of null pointer