Commit 96be95c
committed
Bugfix/MICRSE-4914: Fix incorrect memory freeing in build_pkcs11_uri()
- Use a const pointer to prevent modification of memory returned by getenv().
- Free env_result before reassigning it to prevent invalid memory operations and memory leaks.
Issue originally reported in PR #11.
Reported-by: @andersm
Signed-off-by: Mario Castaneda <mario.ignacio.castaneda.lopez@nxp.com>1 parent b880707 commit 96be95c
2 files changed
Lines changed: 4 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
200 | | - | |
| 199 | + | |
| 200 | + | |
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
564 | 564 | | |
565 | 565 | | |
566 | 566 | | |
567 | | - | |
| 567 | + | |
568 | 568 | | |
569 | 569 | | |
570 | 570 | | |
| |||
604 | 604 | | |
605 | 605 | | |
606 | 606 | | |
607 | | - | |
| 607 | + | |
608 | 608 | | |
609 | 609 | | |
610 | 610 | | |
| |||
619 | 619 | | |
620 | 620 | | |
621 | 621 | | |
622 | | - | |
623 | 622 | | |
624 | 623 | | |
625 | 624 | | |
626 | 625 | | |
627 | 626 | | |
628 | 627 | | |
629 | | - | |
630 | 628 | | |
631 | 629 | | |
632 | | - | |
633 | | - | |
634 | 630 | | |
635 | 631 | | |
636 | 632 | | |
637 | | - | |
638 | 633 | | |
639 | 634 | | |
640 | 635 | | |
| |||
0 commit comments