We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
calloc()
_testembed.c::test_pre_initialization_sys_options
1 parent 872eafd commit 9c6a1f8Copy full SHA for 9c6a1f8
1 file changed
Programs/_testembed.c
@@ -340,8 +340,18 @@ static int test_pre_initialization_sys_options(void)
340
size_t xoption_len = wcslen(static_xoption);
341
wchar_t *dynamic_once_warnoption = \
342
(wchar_t *) calloc(warnoption_len+1, sizeof(wchar_t));
343
+ if (dynamic_once_warnoption == NULL) {
344
+ error("out of memory allocating warnoption");
345
+ return 1;
346
+ }
347
wchar_t *dynamic_xoption = \
348
(wchar_t *) calloc(xoption_len+1, sizeof(wchar_t));
349
+ if (dynamic_xoption == NULL) {
350
+ free(dynamic_once_warnoption);
351
+ error("out of memory allocating xoption");
352
353
354
+
355
wcsncpy(dynamic_once_warnoption, static_warnoption, warnoption_len+1);
356
wcsncpy(dynamic_xoption, static_xoption, xoption_len+1);
357
0 commit comments