pkgtools

morpheus pkg tools
git clone git://git.2f30.org/pkgtools.git
Log | Files | Refs | README | LICENSE

commit ae70afec86c19b110a934f546c5586b2c9103393
parent 74b0a043aecb958886297e75a973d12d3785da57
Author: sin <sin@2f30.org>
Date:   Tue Jun 17 15:45:44 +0100

dp->d_name might be junk so do an estrdup()

Diffstat:
db.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/db.c b/db.c @@ -509,7 +509,7 @@ pkgnew(char *name) struct pkg *pkg; pkg = emalloc(sizeof(*pkg)); - pkg->name = name; + pkg->name = estrdup(name); pkg->head = NULL; return pkg; } @@ -525,5 +525,6 @@ pkgfree(struct pkg *pkg) free(pe); pe = tmp; } + free(pkg->name); free(pkg); }