diff --git a/src/parser_yin.c b/src/parser_yin.c index 601df6757..7e5e6091b 100644 --- a/src/parser_yin.c +++ b/src/parser_yin.c @@ -5093,7 +5093,7 @@ yin_read_module(struct ly_ctx *ctx, const char *data, int implement, struct unre /* add to the context's list of modules */ if (ctx->models.used == ctx->models.size) { - newlist = realloc(ctx->models.list, ctx->models.size * 2); + newlist = realloc(ctx->models.list, sizeof(struct lys_module *) * ctx->models.size * 2); if (!newlist) { LOGMEM; goto error;