Closed Bug 12455 Opened 25 years ago Closed 25 years ago

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

Categories

(Directory :: PerLDAP, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: leif, Assigned: kristian)

Details

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
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
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.