librc-daemon.c: fix memory leaks
This commit is contained in:
parent
72df51e17b
commit
3a803b3135
@ -422,6 +422,7 @@ rc_service_daemon_set(const char *service, const char *exec,
|
|||||||
rename(file, oldfile);
|
rename(file, oldfile);
|
||||||
strlcpy(oldfile, file, sizeof(oldfile));
|
strlcpy(oldfile, file, sizeof(oldfile));
|
||||||
}
|
}
|
||||||
|
free(file);
|
||||||
}
|
}
|
||||||
closedir(dp);
|
closedir(dp);
|
||||||
rc_stringlist_free(match);
|
rc_stringlist_free(match);
|
||||||
@ -446,10 +447,12 @@ rc_service_daemon_set(const char *service, const char *exec,
|
|||||||
fclose(fp);
|
fclose(fp);
|
||||||
retval = true;
|
retval = true;
|
||||||
}
|
}
|
||||||
|
free(file);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
retval = true;
|
retval = true;
|
||||||
|
|
||||||
|
free(dirpath);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
librc_hidden_def(rc_service_daemon_set)
|
librc_hidden_def(rc_service_daemon_set)
|
||||||
|
Loading…
Reference in New Issue
Block a user