mirror of
git://git.gnupg.org/gnupg.git
synced 2025-06-11 18:01:03 +02:00
gpgtar: Fix releasing PROC correctly.
* tools/gpgtar-extract.c (gpgtar_extract): Initialize PROC as NULL, and release at the end for the case of jumping to "leave:" label. * tools/gpgtar-list.c (gpgtar_list): Release at the end. -- Fixes-commit: 29bc14f56f6430294f225b6744012ab1f5df62e6 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
87938a72f2
commit
95d0adfc56
@ -381,7 +381,7 @@ gpgtar_extract (const char *filename, int decrypt)
|
||||
char *dirname = NULL;
|
||||
struct tarinfo_s tarinfo_buffer;
|
||||
tarinfo_t tarinfo = &tarinfo_buffer;
|
||||
gpgrt_process_t proc;
|
||||
gpgrt_process_t proc = NULL;
|
||||
char *logfilename = NULL;
|
||||
unsigned long long notextracted;
|
||||
|
||||
@ -559,7 +559,6 @@ gpgtar_extract (const char *filename, int decrypt)
|
||||
}
|
||||
|
||||
leave:
|
||||
/* fixme: Why can't we use gpgrt_process_release (proc); */
|
||||
notextracted = tarinfo->skipped_badname;
|
||||
notextracted += tarinfo->skipped_suspicious;
|
||||
notextracted += tarinfo->skipped_symlinks;
|
||||
@ -596,5 +595,6 @@ gpgtar_extract (const char *filename, int decrypt)
|
||||
xfree (logfilename);
|
||||
if (stream != es_stdin)
|
||||
es_fclose (stream);
|
||||
gpgrt_process_release (proc);
|
||||
return err;
|
||||
}
|
||||
|
@ -593,11 +593,11 @@ gpgtar_list (const char *filename, int decrypt)
|
||||
}
|
||||
|
||||
leave:
|
||||
/* fixme: Why can't we use gpgrt_process_release (proc); */
|
||||
free_strlist (extheader);
|
||||
xfree (header);
|
||||
if (stream != es_stdin)
|
||||
es_fclose (stream);
|
||||
gpgrt_process_release (proc);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user