# Why does realloc() return NULL?



## sgt_learn (Apr 15, 2013)

I am trying to use the kernel routine realloc(). It consistently returns NULL; supposedly because it cannot complete the request. And yet the kernel memory usage statistics (`vmstat -m`) tick upward each time it is used.


----------



## fluca1978 (Apr 15, 2013)

Just a guess, maybe the M_NOWAIT flag has been specified?



> or
> NULL if the request could not be satisfied (implying that M_NOWAIT was
> set).


----------



## sgt_learn (Apr 27, 2013)

*Sysctl_**

realloc() works fine. The problem I was having was related to how I used SYSCTL_*.

Thanks for the advice.


----------

