(In reply to comment #7)
> > From my reading of the manual page (haven't looked at the source),
> > it looks to me like you need to free() the individual elements too.
>
> Not according to the manpage for putenv(), which states that the string
> passed to putenv() becomes part of the environment directly ("The string
> pointed to by string becomes part of the environment, so altering the string
> changes the environment").
Sorry about the slow response; I subscribed to drm-devel@ recently and that ended up in a total flood of my <email address hidden> mail.
So anyways, yes looks like you're right. The environment APIs are just ugly.
I just looked at the GDM source, and it appears to call the same API, so this makes sense. Pushed to master, thanks!
(In reply to comment #7)
> > From my reading of the manual page (haven't looked at the source),
> > it looks to me like you need to free() the individual elements too.
>
> Not according to the manpage for putenv(), which states that the string
> passed to putenv() becomes part of the environment directly ("The string
> pointed to by string becomes part of the environment, so altering the string
> changes the environment").
Sorry about the slow response; I subscribed to drm-devel@ recently and that ended up in a total flood of my <email address hidden> mail.
So anyways, yes looks like you're right. The environment APIs are just ugly.
I just looked at the GDM source, and it appears to call the same API, so this makes sense. Pushed to master, thanks!