← Commit list

6245202e7

root
root
2009-05-04
FAILED Duration: 37s

Subject

hush: small fix for unset -f on NOMMU.

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

shell/hush.c+5 -5
@@ -2924,13 +2924,13 @@ static void unset_func(const char *name)
while ((funcp = *funcpp) != NULL) {
if (strcmp(funcp->name, name) == 0) {
*funcpp = funcp->next;
- /* funcp is unlinked now, deleting it */
- free(funcp->name);
- /* Note: if !funcp->body, do not free body_as_string!
- * This is a special case of "-F name body" function:
- * body_as_string was not malloced! */
+ /* funcp is unlinked now, deleting it.
+ * Note: if !funcp->body, the function was created by
+ * "-F name body", do not free ->body_as_string
+ * and ->name as they were not malloced. */
if (funcp->body) {
free_pipe_list(funcp->body);
+ free(funcp->name);
# if !BB_MMU
free(funcp->body_as_string);
# endif