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>
(cherry picked from commit 6023acd648)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
45512e188d
commit
0c027ca4d5
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue