On Fri, Aug 14, 2015 at 10:51:59PM +0800, Xiao Guangrong wrote: > +static void set_file(Object *obj, const char *str, Error **errp) > +{ > + PCNVDIMMDevice *nvdimm = PC_NVDIMM(obj); > + > + if (nvdimm->file) { > + g_free(nvdimm->file); > + }
g_free(NULL) is a nop so it's safe to replace the if with just g_free(nvdimm->file).