Add checks for NULL to the config and remote free functions Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>