Skip to content

Commit

Permalink
Fix memory leak with multiple %lang-s in one line
Browse files Browse the repository at this point in the history
We permit two equivalent forms of specifying a list of languages per
file:

  %lang(xx,yy,zz) /path/to/file
  %lang(xx) %lang(yy) %lang(zz) /path/to/file

The leak was when parsing the second form.

Found by Coverity.
  • Loading branch information
dmnks authored and ffesti committed Jun 28, 2021
1 parent 9c093c4 commit 590b2fc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions build/files.c
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,8 @@ static rpmRC parseForLang(char * buf, FileEntry cur)

if (*pe == ',') pe++; /* skip , if present */
}

q = _free(q);
}

rc = RPMRC_OK;
Expand Down

0 comments on commit 590b2fc

Please sign in to comment.