Commit be37ebb 1 parent 547379a commit be37ebb Copy full SHA for be37ebb
File tree 1 file changed +7
-15
lines changed
1 file changed +7
-15
lines changed Original file line number Diff line number Diff line change @@ -254,6 +254,8 @@ t_sendqueue9(void) {
254
254
CU_ASSERT_PTR_NULL (ctx -> sendqueue -> next );
255
255
}
256
256
257
+ static int t_sendqueue_tests_remove (void );
258
+
257
259
static void
258
260
t_sendqueue10 (void ) {
259
261
coap_queue_t * tmp_node ;
@@ -304,18 +306,7 @@ t_sendqueue_tests_create(void) {
304
306
}
305
307
306
308
if (error ) {
307
- /* destroy all test nodes and set entry to zero */
308
- for (n = 0 ; n < sizeof (node )/sizeof (coap_queue_t * ); n ++ ) {
309
- if (node [n ]) {
310
- /* As coap_delete_node() is not in the Public API, need to lock */
311
- coap_lock_lock (ctx , continue );
312
- coap_delete_node (node [n ]);
313
- coap_lock_unlock (ctx );
314
- node [n ] = NULL ;
315
- }
316
- }
317
- coap_free_context (ctx );
318
- ctx = NULL ;
309
+ t_sendqueue_tests_remove ();
319
310
}
320
311
321
312
return error ;
@@ -324,16 +315,17 @@ t_sendqueue_tests_create(void) {
324
315
static int
325
316
t_sendqueue_tests_remove (void ) {
326
317
size_t n ;
318
+ /* As coap_delete_node() is not in the Public API, need to lock */
319
+ coap_lock_lock (ctx , return 1 );
327
320
for (n = 0 ; n < sizeof (node )/sizeof (coap_queue_t * ); n ++ ) {
328
321
if (node [n ]) {
329
- /* As coap_delete_node() is not in the Public API, need to lock */
330
- coap_lock_lock (ctx , continue );
331
322
coap_delete_node (node [n ]);
332
- coap_lock_unlock (ctx );
333
323
node [n ] = NULL ;
334
324
}
335
325
}
326
+ coap_lock_unlock (ctx );
336
327
coap_free_context (ctx );
328
+ ctx = NULL ;
337
329
return 0 ;
338
330
}
339
331
You can’t perform that action at this time.
0 commit comments