mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-15 20:05:13 +02:00
10 lines
229 B
C
10 lines
229 B
C
|
|
#include <stdlib.h>
|
||
|
|
|
||
|
|
/* malloc without free — resource leak.
|
||
|
|
Tests the memory resource pair (malloc → free).
|
||
|
|
Expected: state-resource-leak. */
|
||
|
|
void malloc_leak(void) {
|
||
|
|
void *p = malloc(100);
|
||
|
|
*(char *)p = 'x';
|
||
|
|
}
|