if (ret < 0) {
goto error;
}
- buffer_reg_pid_add(reg_pid);
} else {
goto end;
}
app->byte_order, app->version.major,
app->version.minor);
if (ret < 0) {
+ /*
+ * reg_pid->registry->reg.ust is NULL upon error, so we need to
+ * destroy the buffer registry, because it is always expected
+ * that if the buffer registry can be found, its ust registry is
+ * non-NULL.
+ */
+ buffer_reg_pid_destroy(reg_pid);
goto error;
}
+ buffer_reg_pid_add(reg_pid);
+
DBG3("UST app buffer registry per PID created successfully");
end:
if (ret < 0) {
goto error;
}
- buffer_reg_uid_add(reg_uid);
} else {
goto end;
}
app->byte_order, app->version.major,
app->version.minor);
if (ret < 0) {
+ /*
+ * reg_uid->registry->reg.ust is NULL upon error, so we need to
+ * destroy the buffer registry, because it is always expected
+ * that if the buffer registry can be found, its ust registry is
+ * non-NULL.
+ */
+ buffer_reg_uid_destroy(reg_uid, NULL);
goto error;
}
/* Add node to teardown list of the session. */
cds_list_add(®_uid->lnode, &usess->buffer_reg_uid_list);
- DBG3("UST app buffer registry per UID created successfully");
+ buffer_reg_uid_add(reg_uid);
+ DBG3("UST app buffer registry per UID created successfully");
end:
if (regp) {
*regp = reg_uid;