View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0005137 | GNUnet | other | public | 2017-09-20 10:21 | 2018-06-07 00:24 |
| Reporter | Peter Jankuliak | Assigned To | nikita | ||
| Priority | normal | Severity | minor | Reproducibility | have not tried |
| Status | closed | Resolution | fixed | ||
| Summary | 0005137: argv should not be explicitly freed | ||||
| Description | I noticed this in several c files which have the 'main' function. E.g. here https://gnunet.org/git/gnunet.git/tree/src/cadet/gnunet-cadet.c?id=37d4b1f14ebc692efe9a2744946ba2bfd8ccf6d3#n985 https://gnunet.org/git/gnunet.git/tree/src/vpn/gnunet-vpn.c?id=37d4b1f14ebc692efe9a2744946ba2bfd8ccf6d3#n346 Unfortunately, I am unable to find a C reference specification where they explicitly mention that it should not be freed, but I have never seen it done in any projects I've ever worked on (see e.g. the example section in `man execve` [0]) and posts such as these [1] [2] [3] suggest that it results in unspecified behavior: [0] https://linux.die.net/man/2/execve [1] https://stackoverflow.com/questions/34619558/is-it-required-to-free-or-delete-the-arguments-passed-into-main-in-c/34619581 [2] https://stackoverflow.com/questions/26416678/where-does-the-os-store-argv-and-argc-when-a-child-process-is-executed [3] https://stackoverflow.com/questions/25850285/memory-allocation-and-argv-argument | ||||
| Tags | No tags attached. | ||||
|
|
Ah, I spoke too soon. I missed the fact that the function GNUNET_STRINGS_get_utf8_args overwrites argv. |
|
|
Sorry for the noise, feel free to close this non-issue. |
|
|
Thanks for the report, even if it's a non-issue. So by your own findings it can be closed as resolved? |
|
|
> So by your own findings it can be closed as resolved? Yes please. |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2017-09-20 10:21 | Peter Jankuliak | New Issue | |
| 2017-09-20 10:53 | Peter Jankuliak | Note Added: 0012428 | |
| 2017-09-20 13:40 | Peter Jankuliak | Note Added: 0012429 | |
| 2017-09-24 12:44 | nikita | Assigned To | => nikita |
| 2017-09-24 12:44 | nikita | Status | new => acknowledged |
| 2017-09-24 12:45 | nikita | Note Added: 0012431 | |
| 2017-09-24 12:45 | nikita | Status | acknowledged => feedback |
| 2017-09-24 13:44 | Peter Jankuliak | Note Added: 0012433 | |
| 2017-09-24 13:44 | Peter Jankuliak | Status | feedback => assigned |
| 2017-09-24 14:08 | nikita | Status | assigned => resolved |
| 2017-09-24 14:08 | nikita | Resolution | open => fixed |
| 2018-06-07 00:24 | Christian Grothoff | Status | resolved => closed |