Skip to content

Commit

Permalink
optimize the code in cmsFreeProfileSequenceDescription()
Browse files Browse the repository at this point in the history
  • Loading branch information
x2018 committed Oct 26, 2023
1 parent 32ded9e commit e5ec2b1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/cmsnamed.c
Original file line number Diff line number Diff line change
Expand Up @@ -817,15 +817,16 @@ void CMSEXPORT cmsFreeProfileSequenceDescription(cmsSEQ* pseq)
if (pseq == NULL)
return;

for (i=0; i < pseq ->n; i++) {
if (pseq->seq != NULL) {
if (pseq ->seq != NULL) {
for (i=0; i < pseq ->n; i++) {
if (pseq ->seq[i].Manufacturer != NULL) cmsMLUfree(pseq ->seq[i].Manufacturer);
if (pseq ->seq[i].Model != NULL) cmsMLUfree(pseq ->seq[i].Model);
if (pseq ->seq[i].Description != NULL) cmsMLUfree(pseq ->seq[i].Description);
}

_cmsFree(pseq ->ContextID, pseq ->seq);
}

if (pseq ->seq != NULL) _cmsFree(pseq ->ContextID, pseq ->seq);
_cmsFree(pseq -> ContextID, pseq);
}

Expand Down

0 comments on commit e5ec2b1

Please sign in to comment.