Skip to content

Commit

Permalink
Merge pull request #406 from x2018/cmsFreeProfileSequenceDescription
Browse files Browse the repository at this point in the history
optimize the code in cmsFreeProfileSequenceDescription()
Ok, that's cosmetic but I like your attention to detail. Looks great, thank you!
  • Loading branch information
mm2 authored Oct 26, 2023
2 parents 32ded9e + e5ec2b1 commit 5c0655a
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 5c0655a

Please sign in to comment.