Properly initialize pipeline structures
We weren't setting simple fields to 0/NULL, causing reads from
uninitialized memory
Tested-by: Build Bot
@@ -543,6 +543,15 @@ int
mcreq_pipeline_init(mc_PIPELINE *pipeline)
{
nb_SETTINGS settings;
+
+ /* Initialize all members to 0 */
+ memset(&pipeline->requests, 0, sizeof pipeline->requests);
+ pipeline->parent = NULL;
+ pipeline->flush_start = NULL;
+ pipeline->index = 0;
+ memset(&pipeline->ctxqueued, 0, sizeof pipeline->ctxqueued);
+ pipeline->buf_done_callback = NULL;
+
netbuf_default_settings(&settings);
/** Initialize datapool */
@@ -550,7 +559,7 @@ mcreq_pipeline_init(mc_PIPELINE *pipeline)
/** Initialize request pool */
settings.data_basealloc = sizeof(mc_PACKET) * 32;
- netbuf_init(&pipeline->reqpool, &settings);
+ netbuf_init(&pipeline->reqpool, &settings);;
return 0;
}
