[Xastir-Dev] "Reindex ALL Maps" SIG-11 fix

Derrick J Brashear shadow at dementia.org
Sun Aug 17 14:59:46 EDT 2003


On Sun, 17 Aug 2003, Henk de Groot wrote:

> I just installed the Xastir CVS version with the changed paths (yes, I'm
> not very active at the moment...). One of the instructions in the UPDATE
> document is to reindex the maps. On my system this resulted in a SIG-11
> fault. Here is the patch to maps.c to fix it. It is trivial, the assignment
> "current = current->next;" is at the wrong place (fault occured at "if
> (current->XmStringPtr != NULL) {" with "current" == NULL).

Won't this leak the first string to be freed?
Isn't the correct answer to instead free temp->XmStringPtr?

> ------------------------------------------------------------------------
> --- xastir/src/maps.c.orig	Sun Aug 17 15:29:30 2003
> +++ xastir/src/maps.c	Sun Aug 17 20:37:49 2003
> @@ -2812,14 +2812,14 @@
>
>       current = index_list_head;
>
>       while (current != NULL) {
>           temp = current;
> -        current = current->next;
>           if (current->XmStringPtr != NULL) {
>               XmStringFree(current->XmStringPtr);
>           }
> +        current = current->next;
>           free(temp);
>       }
>
>       index_list_head = NULL;
>   }



More information about the Xastir-dev mailing list