add: if(image==NULL) return;
context: free_gerb_image(gerb_image_t *image){    int i;    gerb_net_t *net, *tmp;        /*     * Free apertures     */    for (i = 0; i < APERTURE_MAX; i++) 	if (image->aperture[i] != NULL) {	    free(image->aperture[i]);	    image->aperture[i] = NULL;	}    /*     * Free aperture macro     */    if (image->amacro)	free_amacro(image->amacro);    /*     * Free format     */    if (image->format)	free(image->format);        /*     * Free info     */    if (image->info) {	if (image->info->name)	    free(image->info->name);	free(image->info);    }        /*     * Free netlist     */    for (net = image->netlist; net != NULL; ) {	tmp = net; 	net = net->next; 	if (tmp->cirseg != NULL) {	    free(tmp->cirseg);	    tmp->cirseg = NULL;	}	free(tmp);	tmp = NULL;    }        gerb_transf_free(image->transf);    /*     * Free and reset the final image     */    free(image);    image = NULL;        return;} /* free_gerb_image */