|
Lines 294-307
Link Here
|
| 294 |
to the allocated memory |
294 |
to the allocated memory |
| 295 |
if successful; otherwise a |
295 |
if successful; otherwise a |
| 296 |
.Dv NULL |
296 |
.Dv NULL |
| 297 |
pointer is returned, in which case the |
297 |
pointer is returned, and |
| 298 |
memory referenced by |
|
|
| 299 |
.Fa ptr |
| 300 |
is still available and intact. |
| 301 |
In the case of memory allocation failure, |
| 302 |
.Va errno |
298 |
.Va errno |
| 303 |
is set to |
299 |
is set to |
| 304 |
.Er ENOMEM . |
300 |
.Er ENOMEM |
|
|
301 |
if the error was the result of an allocation failure. |
| 302 |
The |
| 303 |
.Fn realloc |
| 304 |
function always leaves the original buffer intact |
| 305 |
when an error occurs, whereas |
| 306 |
.Fn reallocf |
| 307 |
deallocates it in this case. |
| 305 |
.Pp |
308 |
.Pp |
| 306 |
The |
309 |
The |
| 307 |
.Fn free |
310 |
.Fn free |