Commit 90b599f
committed
Low: libcib: Avoid memory leak in processing CIB file commit transaction
process_transaction_requests() wasn't freeing output. Do that now.
Also simplify the freeing of output.
* process_request(): Make a copy of *output if it's not in the same doc
as private->cib_xml. This lets us simplify file_perform_op_delegate().
* process_request(): No operation leaves result_cib set to the same
value as *output unless it's also equal to private->cib_xml. (A query
op can do this.) So drop a check in the done section.
* file_perform_op_delegate(): Return only at the end of the function,
within the done section.
* file_perform_op_delegate(): Don't assign *output_data = NULL at the
beginning. We'll do this in the done section if output is NULL.
* file_perform_op_delegate(): Assume that output is not in the same
document as private->cib_xml. We ensured this in process_request().
* file_perform_op_delegate(): Free output if and only if it has not been
assigned to *output_data.
And do the standard-to-legacy conversion at the end of
file_perform_op_delegate(), in the done section.
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>1 parent beb78cc commit 90b599f
1 file changed
Lines changed: 29 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
194 | 202 | | |
195 | | - | |
| 203 | + | |
196 | 204 | | |
197 | 205 | | |
198 | 206 | | |
| |||
226 | 234 | | |
227 | 235 | | |
228 | 236 | | |
| 237 | + | |
| 238 | + | |
229 | 239 | | |
230 | 240 | | |
231 | 241 | | |
| |||
403 | 413 | | |
404 | 414 | | |
405 | 415 | | |
406 | | - | |
407 | | - | |
| 416 | + | |
| 417 | + | |
408 | 418 | | |
409 | 419 | | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | 420 | | |
415 | | - | |
| 421 | + | |
| 422 | + | |
416 | 423 | | |
417 | 424 | | |
418 | 425 | | |
419 | | - | |
420 | | - | |
| 426 | + | |
421 | 427 | | |
422 | | - | |
| 428 | + | |
| 429 | + | |
423 | 430 | | |
424 | 431 | | |
425 | 432 | | |
426 | 433 | | |
427 | 434 | | |
428 | | - | |
| 435 | + | |
| 436 | + | |
429 | 437 | | |
430 | 438 | | |
431 | 439 | | |
432 | 440 | | |
433 | 441 | | |
434 | 442 | | |
435 | | - | |
436 | | - | |
437 | | - | |
| 443 | + | |
| 444 | + | |
438 | 445 | | |
439 | 446 | | |
440 | 447 | | |
441 | 448 | | |
442 | 449 | | |
443 | 450 | | |
444 | 451 | | |
445 | | - | |
446 | 452 | | |
447 | 453 | | |
448 | 454 | | |
449 | 455 | | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | 456 | | |
460 | 457 | | |
461 | | - | |
462 | | - | |
463 | | - | |
| 458 | + | |
464 | 459 | | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
465 | 464 | | |
466 | 465 | | |
467 | | - | |
468 | | - | |
| 466 | + | |
| 467 | + | |
469 | 468 | | |
470 | 469 | | |
471 | 470 | | |
| |||
0 commit comments