File: xstructor.c

package info (click to toggle)
njamd 0.9.3pre2-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,704 kB
  • ctags: 1,056
  • sloc: ansic: 9,367; sh: 7,921; makefile: 121; perl: 52
file content (26 lines) | stat: -rwxr-xr-x 359 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <stdio.h>
#include <stdlib.h>

void tmp(void) __attribute__ ((destructor));
void tmp1(void) __attribute__ ((constructor));
char *buf, *buf2;

void tmp1(void) 
{
    buf2 = malloc(20);
    free(buf2);
    buf2 = malloc(20);
}

void tmp(void)
{
    free(buf);
    free(buf2);
    buf = malloc(20);
}

int main()
{
    buf = malloc(20);
    return 0;
}