Skip to content

Commit

Permalink
sysusers: fix memleak (systemd#4443)
Browse files Browse the repository at this point in the history
Fixes:
Oct 20 09:10:49 systemd-sysusers[144]: Direct leak of 20 byte(s) in 1 object(s) allocated from:
Oct 20 09:10:49 systemd-sysusers[144]:     #0 0x7f3565a13e60 in malloc (/lib64/libasan.so.3+0xc6e60)
Oct 20 09:10:49 systemd-sysusers[144]:     systemd#1 0x7f3565526bd0 in malloc_multiply src/basic/alloc-util.h:70
Oct 20 09:10:49 systemd-sysusers[144]:     systemd#2 0x7f356552cb55 in tempfn_xxxxxx src/basic/fileio.c:1116
Oct 20 09:10:49 systemd-sysusers[144]:     systemd#3 0x7f356552c4f0 in fopen_temporary src/basic/fileio.c:1042
Oct 20 09:10:49 systemd-sysusers[144]:     systemd#4 0x7f356555e00e in fopen_temporary_label src/basic/fileio-label.c:63
Oct 20 09:10:49 systemd-sysusers[144]:     systemd#5 0x56197c4a1766 in make_backup src/sysusers/sysusers.c:209
Oct 20 09:10:49 systemd-sysusers[144]:     systemd#6 0x56197c4a6335 in write_files src/sysusers/sysusers.c:710
Oct 20 09:10:49 systemd-sysusers[144]:     systemd#7 0x56197c4ae571 in main src/sysusers/sysusers.c:1817
Oct 20 09:10:49 systemd-sysusers[144]:     systemd#8 0x7f3564dee730 in __libc_start_main (/lib64/libc.so.6+0x20730)
  • Loading branch information
evverx authored and poettering committed Oct 21, 2016
1 parent 75e2089 commit 0a12bb1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/sysusers/sysusers.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ static int load_group_database(void) {
static int make_backup(const char *target, const char *x) {
_cleanup_close_ int src = -1;
_cleanup_fclose_ FILE *dst = NULL;
char *backup, *temp;
_cleanup_free_ char *temp = NULL;
char *backup;
struct timespec ts[2];
struct stat st;
int r;
Expand Down

0 comments on commit 0a12bb1

Please sign in to comment.