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:
parent
a5f3815c65
commit
6023acd648
1 changed files with 7 additions and 5 deletions
|
@ -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 a new issue