#include <stdio.h>
#include <stdlib.h>
typedef struct _Foo_
{
int number;
char character;
float ratio;
} Foo;
Foo* createFoo()
{
return (Foo
*)malloc(sizeof(Foo
)); }
void destroyFoo(Foo** foo)
{
if (!foo | !(*foo)) return;
*foo = NULL;
}
int main()
{
Foo* a = NULL;
Foo* b = createFoo();
destroyFoo(NULL);
destroyFoo(&a);
destroyFoo(&b);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCnR5cGVkZWYgc3RydWN0IF9Gb29fCnsKICAgIGludCBudW1iZXI7CiAgICBjaGFyIGNoYXJhY3RlcjsKICAgIGZsb2F0IHJhdGlvOwoKfSBGb287CgpGb28qIGNyZWF0ZUZvbygpCnsKCXJldHVybiAoRm9vKiltYWxsb2Moc2l6ZW9mKEZvbykpOwp9Cgp2b2lkIGRlc3Ryb3lGb28oRm9vKiogZm9vKQp7CiAgICBpZiAoIWZvbyB8ICEoKmZvbykpIHJldHVybjsKICAgIGZyZWUoKmZvbyk7CiAgICAqZm9vID0gTlVMTDsKfQoKaW50IG1haW4oKQp7CglGb28qIGEgPSBOVUxMOwogICAgRm9vKiBiID0gY3JlYXRlRm9vKCk7CiAgICAKICAgIGRlc3Ryb3lGb28oTlVMTCk7CiAgICBkZXN0cm95Rm9vKCZhKTsKICAgIGRlc3Ryb3lGb28oJmIpOwoJCglwcmludGYoInN1Y2Nlc3MiKTsKCXJldHVybiAwOwp9Cg==