forking heap problem fully solved FTR.
- From: Edscott Wilson García <edscott imp mx>
- To: gtk mailing list <gtk-list gnome org>
- Subject: forking heap problem fully solved FTR.
- Date: Wed, 5 Dec 2001 06:44:17 -0600
Please excuse the bandwidth I used for the problem I described previously
where the child process was invading the memory the parent was using for
GTK. It was a very stupid mistake, as you can see below in that the case
where strrchr() returning NULL is not considered, thus causing a memory error
in the child. This memory error in turn causes a "X-io error" in the parent.
if (stat(target,&t_stat)<0){ /* follow link stat() */
route=(char *)malloc(strlen(target+1));
if (route) {
strcpy(route,target);
end=strrchr(route,'/');
if (end==route) end[1]=0; /* root directory */
else end[0]=0;
stat(route,&t_stat);
free(route);
}
}
Saludos
Edscott Wilson Garcia.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]