Plan 9 from Bell Labs’s /usr/web/sources/patch/sorry/acme-fontnames/notes

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


Mon Dec 6 12:16:25 EST 2004 rsc
    why is this okay?  i think maybe the stuff in fontnames should be estrdup'ed.
    and then then free is okay.  right now for example there are calls to
    rfget that could copy name into the array and then the next line after
    the rfget call is free(name).  so estrdup seems required.
    and once estrdup is required the free is correct.
    

Thu Dec 9 13:09:33 EST 2004 swasey
    The small space leak did not bother me (or, presumably, the original author).
    As you suggest, it would be better to estrdup the initial values
    and establish the invariant that after that initialization,
    fontnames[i] are allocated with malloc.  Some "missing" frees could be
    added.  I can submit another patch.


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.