Bug 35291: Prevent leaks from FS

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2023-11-08 17:14:55 +01:00 committed by Tomas Cohen Arazi
parent a5f3815c65
commit 6023acd648
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -175,9 +175,9 @@ if ($fileID) {
: "";
unless ( $delim eq "," || $delim eq "\t" ) {
warn
"Unrecognized or missing field delimeter. Please verify that you are using either a ',' or a 'tab'";
warn "Unrecognized or missing field delimeter. Please verify that you are using either a ',' or a 'tab'";
$error = 'DELERR';
next;
}
else {
( $biblionumber, $filename ) = split $delim, $line, 2;
@ -186,9 +186,6 @@ if ($fileID) {
$filename =~ s/[\"\r\n]//g;
$filename =~ s/^\s+//;
$filename =~ s/\s+$//;
if (C4::Context->preference("CataloguingLog")) {
logaction('CATALOGUING', 'MODIFY', $biblionumber, "biblio cover image: $filename");
}
my $srcimage = GD::Image->new("$dir/$filename");
my $biblio;
my $item;
@ -238,6 +235,11 @@ if ($fileID) {
$error = 'OPNIMG';
}
undef $srcimage;
if (!$error && C4::Context->preference("CataloguingLog")) {
logaction('CATALOGUING', 'MODIFY', $biblionumber, "biblio cover image: $filename");
}
}
}
close($fh);