Skip to content

Commit cb1df2f

Browse files
committed
README: Add note about needing to free print results in examples
1 parent 2c914c0 commit cb1df2f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ In this example we want to build and parse the following JSON:
298298
Let's build the above JSON and print it to a string:
299299
```c
300300
//create a monitor with a list of supported resolutions
301+
//NOTE: Returns a heap allocated string, you are required to free it after use.
301302
char* create_monitor(void)
302303
{
303304
const unsigned int resolution_numbers[3][2] = {
@@ -373,6 +374,7 @@ end:
373374
374375
Alternatively we can use the `cJSON_Add...ToObject` helper functions to make our lifes a little easier:
375376
```c
377+
//NOTE: Returns a heap allocated string, you are required to free it after use.
376378
char *create_monitor_with_helpers(void)
377379
{
378380
const unsigned int resolution_numbers[3][2] = {

0 commit comments

Comments
 (0)