Problems with LDIF.pm in v1.4, memory leaks etc.

RESOLVED FIXED

Status

Directory
PerLDAP
P3
normal
RESOLVED FIXED
18 years ago
18 years ago

People

(Reporter: Leif Hedstrom, Assigned: kristian)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

18 years ago
From: Taras Dowhaluk <tarasd@visiondb.com.au>

G'day Leif,

I've been testing 1.3.4 and was hoping to finish before you cut 1.4,
when I just saw you're post, damn and double damn.

Anyhow, there's 2 issues with printLDIF():

1. In Entry.pm, the line at 808:
          grep((print "$attr: $_\n"), @$values);
should probably be:
        if (ref($values) eq 'ARRAY') {
          grep((print "$attr: $_\n"), @$values);
        } else {
          print "$attr: $values\n";
        }
otherwise we get:
Can't use string ("blah, blah") as an ARRAY ref while "strict refs"
in use at d:/UTILS/perl/site/lib/Mozilla/LDAP/Entry.pm line 808.

2. There is a reasonable sized memory leak in LDIF.pm: put_LDIF(),
especially noticable if printfLDIF() is called within a loop, eg.

    # Loop test.
    for ($count = 0; $count <= 2000; $count++) {
        $ent = $conn->search($ld{root}, $ld{scope}, $filter);
        last unless ($ent);
       print "Loop: $count=$ent\n";
       $ent->printLDIF();
    }

A workaround is to put
    undef $record;
at the bottom of the loop at line 229.


regards, taras
(Assignee)

Updated

18 years ago
Status: NEW → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED
(Assignee)

Comment 1

18 years ago
I fixed these bugs in devel-branch-1_3
Entry.pm revision: 1.10.2.23
LDIF.pm  revision: 1.6.2.13
You need to log in before you can comment on or make changes to this bug.