callers of PK11_MakeString may leak allocated result.

NEW
Assigned to

Status

P3
minor
9 years ago
8 years ago

People

(Reporter: timeless, Assigned: rrelyea)

Tracking

({coverity})

trunk
coverity

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

9 years ago
PK11_MakeString can fail because of oom, and in both cases tmp isn't null checked which means whatever the goal is, it probably isn't working.
Assignee: nobody → rrelyea
Summary: tmp = PK11_MakeString(...) is a bad pattern → callers of PK11_MakeString don't check result for NULL
    * line 1145 -- tmp = PK11_MakeString(NULL,slot->token_name,
    * line 1377 -- tmp = PK11_MakeString(NULL,slot->slot_name, 

In these cases, PK11_MakeString returns its second argument.
I guess it's remotely conceivable that the value of that argument
could be NULL, in which case PK11_MakeString will return the address
of an allocated string, which will then be leaked because these callers
do NOTHING with tmp.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3
Summary: callers of PK11_MakeString don't check result for NULL → callers of PK11_MakeString may leak allocated result.
You need to log in before you can comment on or make changes to this bug.