@@ -272,9 +272,9 @@ ly_ctx_ht_err_equal_cb(void *val1_p, void *val2_p, ly_bool UNUSED(mod), void *UN
272
272
static ly_bool
273
273
ly_ctx_ht_leafref_links_equal_cb (void * val1_p , void * val2_p , ly_bool UNUSED (mod ), void * UNUSED (cb_data ))
274
274
{
275
- struct lyd_leafref_links_rec * rec1 = val1_p , * rec2 = val2_p ;
275
+ struct lyd_leafref_links_rec * * rec1 = val1_p , * * rec2 = val2_p ;
276
276
277
- return rec1 -> node == rec2 -> node ;
277
+ return ( * rec1 ) -> node == ( * rec2 ) -> node ;
278
278
}
279
279
280
280
/**
@@ -285,9 +285,10 @@ ly_ctx_ht_leafref_links_equal_cb(void *val1_p, void *val2_p, ly_bool UNUSED(mod)
285
285
static void
286
286
ly_ctx_ht_leafref_links_rec_free (void * val_p )
287
287
{
288
- struct lyd_leafref_links_rec * rec = val_p ;
288
+ struct lyd_leafref_links_rec * * rec = val_p ;
289
289
290
- lyd_free_leafref_links_rec (rec );
290
+ lyd_free_leafref_links_rec (* rec );
291
+ free (* rec );
291
292
}
292
293
293
294
LIBYANG_API_DEF LY_ERR
@@ -316,7 +317,7 @@ ly_ctx_new(const char *search_dir, uint16_t options, struct ly_ctx **new_ctx)
316
317
LY_CHECK_ERR_GOTO (lyplg_init (builtin_plugins_only ), LOGINT (NULL ); rc = LY_EINT , cleanup );
317
318
318
319
if (options & LY_CTX_LEAFREF_LINKING ) {
319
- ctx -> leafref_links_ht = lyht_new (1 , sizeof (struct lyd_leafref_links_rec ), ly_ctx_ht_leafref_links_equal_cb , NULL , 1 );
320
+ ctx -> leafref_links_ht = lyht_new (1 , sizeof (struct lyd_leafref_links_rec * ), ly_ctx_ht_leafref_links_equal_cb , NULL , 1 );
320
321
LY_CHECK_ERR_GOTO (!ctx -> leafref_links_ht , rc = LY_EMEM , cleanup );
321
322
}
322
323
@@ -654,7 +655,7 @@ ly_ctx_set_options(struct ly_ctx *ctx, uint16_t option)
654
655
}
655
656
656
657
if (!(ctx -> flags & LY_CTX_LEAFREF_LINKING ) && (option & LY_CTX_LEAFREF_LINKING )) {
657
- ctx -> leafref_links_ht = lyht_new (1 , sizeof (struct lyd_leafref_links_rec ), ly_ctx_ht_leafref_links_equal_cb , NULL , 1 );
658
+ ctx -> leafref_links_ht = lyht_new (1 , sizeof (struct lyd_leafref_links_rec * ), ly_ctx_ht_leafref_links_equal_cb , NULL , 1 );
658
659
LY_CHECK_ERR_RET (!ctx -> leafref_links_ht , LOGARG (ctx , option ), LY_EMEM );
659
660
}
660
661
0 commit comments