29 lines
421 B
C
29 lines
421 B
C
|
|
||
|
void *malloc(unsigned long);
|
||
|
void free(void *);
|
||
|
|
||
|
struct comment {
|
||
|
int *p;
|
||
|
};
|
||
|
|
||
|
struct table {
|
||
|
struct comment *p;
|
||
|
};
|
||
|
|
||
|
void delete_table(struct table *t)
|
||
|
{
|
||
|
free(t->p->p);
|
||
|
free(t->p);
|
||
|
free(t);
|
||
|
}
|
||
|
|
||
|
void f()
|
||
|
{
|
||
|
struct table *t = (struct table *)malloc(sizeof(struct table));
|
||
|
struct comment *comment_rec = (struct comment *)malloc(sizeof(struct comment));
|
||
|
t->p = comment_rec;
|
||
|
delete_table(t);
|
||
|
}
|
||
|
|
||
|
|