Index: trunk/src/buffer.c =================================================================== --- trunk/src/buffer.c (revision 27542) +++ trunk/src/buffer.c (revision 27543) @@ -120,6 +120,7 @@ pcb_data_bind_board_layers(pcb, Buffer->Data, 0); } Buffer->from_outside = 0; + free(Buffer->source_path); Buffer->source_path = NULL; } void pcb_buffer_clear(pcb_board_t *pcb, pcb_buffer_t *Buffer) @@ -157,6 +158,7 @@ Buffer->Y = pcb_crosshair.Y; } Buffer->from_outside = 0; + free(Buffer->source_path); Buffer->source_path = NULL; pcb_notify_crosshair_change(pcb_true); } @@ -228,6 +230,7 @@ pcb_data_binding_update(pcb, Buffer->Data); pcb_board_remove(newPCB); Buffer->from_outside = 1; + free(Buffer->source_path); Buffer->source_path = pcb_strdup(Filename); PCB = orig; pcb_layergrp_inhibit_dec(); return pcb_true; @@ -240,6 +243,7 @@ PCB = orig; pcb_layergrp_inhibit_dec(); Buffer->from_outside = 0; + free(Buffer->source_path); Buffer->source_path = NULL; return pcb_false; } @@ -749,6 +753,7 @@ Buffer->X = 0; Buffer->Y = 0; Buffer->from_outside = 1; + free(Buffer->source_path); Buffer->source_path = pcb_strdup(Name); if (pcb_subclist_length(&Buffer->Data->subc)) { pcb_subc_t *subc = pcb_subclist_first(&Buffer->Data->subc); Index: trunk/src/buffer.h =================================================================== --- trunk/src/buffer.h (revision 27542) +++ trunk/src/buffer.h (revision 27543) @@ -40,6 +40,7 @@ pcb_box_t bbox_naked; pcb_data_t *Data; /* data; not all members of pcb_board_t */ int from_outside; /* data is coming from outside of the current board (lib, loaded board) */ + char *source_path; /* when from the outside, this field may remember the full path of the original source file */ }; /* Recalculates the bounding box of the buffer; returns 0 on success */