@@ -252,9 +252,12 @@ test_plugin_hup_signal_handling(void)
252252 if (!old_config1 || !old_config2 || !old_config3 )
253253 TEST_FAIL ("failed to create old plugin configs" );
254254
255- plist_append (& old_plugin_list , old_config1 );
256- plist_append (& old_plugin_list , old_config2 );
257- plist_append (& old_plugin_list , old_config3 );
255+ if (plist_append (& old_plugin_list , old_config1 ) != 0 )
256+ TEST_FAIL ("failed to append old_config1" );
257+ if (plist_append (& old_plugin_list , old_config2 ) != 0 )
258+ TEST_FAIL ("failed to append old_config2" );
259+ if (plist_append (& old_plugin_list , old_config3 ) != 0 )
260+ TEST_FAIL ("failed to append old_config3" );
258261
259262 // Create new configuration (remove audit-af_unix, add audit-custom-plugin, keep others)
260263 new_config1 = create_test_plugin ("audit-remote" , A_YES , "/usr/sbin/audit-remote" );
@@ -264,9 +267,12 @@ test_plugin_hup_signal_handling(void)
264267 if (!new_config1 || !new_config2 || !new_config4 )
265268 TEST_FAIL ("failed to create new plugin configs" );
266269
267- plist_append (& new_plugin_list , new_config1 );
268- plist_append (& new_plugin_list , new_config2 );
269- plist_append (& new_plugin_list , new_config4 );
270+ if (plist_append (& new_plugin_list , new_config1 ) != 0 )
271+ TEST_FAIL ("failed to append new_config1" );
272+ if (plist_append (& new_plugin_list , new_config2 ) != 0 )
273+ TEST_FAIL ("failed to append new_config2" );
274+ if (plist_append (& new_plugin_list , new_config4 ) != 0 )
275+ TEST_FAIL ("failed to append new_config4" );
270276
271277 // Simulate HUP signal handling: mark all old plugins as unchecked
272278 plist_mark_all_unchecked (& old_plugin_list );
@@ -283,17 +289,21 @@ test_plugin_hup_signal_handling(void)
283289 // Plugin exists in old list, mark as checked
284290 old_node -> p -> checked = 1 ;
285291
286- // Verify configuration update (audit-syslog changed from A_YES to A_NO)
292+ // Verify configuration update (audit-syslog changed
293+ // from A_YES to A_NO)
287294 if (strcmp (new_node -> p -> name , "audit-syslog" ) == 0 ) {
288- if (old_node -> p -> active == A_YES && new_node -> p -> active == A_NO ) {
289- // This simulates updating the configuration
295+ if (old_node -> p -> active ==
296+ A_YES && new_node -> p -> active == A_NO ) {
297+ // This simulates updating the
298+ // configuration
290299 old_node -> p -> active = A_NO ;
291300 }
292301 }
293302 } else {
294303 // New plugin, add to old list
295304 plist_last (& old_plugin_list );
296- plist_append (& old_plugin_list , new_node -> p );
305+ if (plist_append (& old_plugin_list , new_node -> p ) != 0 )
306+ TEST_FAIL ("failed to append new plugin to old list" );
297307 }
298308
299309 new_node = plist_next (& new_plugin_list );
@@ -374,7 +384,8 @@ test_plugin_iteration_and_startup(void)
374384 for (i = 0 ; i < 5 ; i ++ ) {
375385 if (!configs [i ])
376386 TEST_FAIL ("failed to create plugin config" );
377- plist_append (& plugin_list , configs [i ]);
387+ if (plist_append (& plugin_list , configs [i ]) != 0 )
388+ TEST_FAIL ("failed to append plugin config" );
378389 }
379390
380391 // Simulate plugin startup iteration (like start_plugins in audispd.c)
@@ -413,7 +424,8 @@ test_plugin_iteration_and_startup(void)
413424 TEST_FAIL ("failed to create new plugin config" );
414425
415426 plist_last (& plugin_list );
416- plist_append (& plugin_list , config_new );
427+ if (plist_append (& plugin_list , config_new ) != 0 )
428+ TEST_FAIL ("failed to append new plugin" );
417429
418430 if (plist_count (& plugin_list ) != 6 )
419431 TEST_FAIL ("should have 6 plugins after append" );
0 commit comments