The push_cleanup() call takes a pointer to the fd variable which resides in the stack. In case of error and stack unwinding due to longjmp, the value of fd might get overwritten by subsequent stack usage. Thus this kind of variables need to be static so that their value cannot change on stack rollback.
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||