Skip to content

Commit

Permalink
added free(key) on error case; coverity #23
Browse files Browse the repository at this point in the history
  • Loading branch information
craigbarratt committed Jul 24, 2021
1 parent da7bd11 commit 7215af4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions backuppc/bpc_attrib.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ void bpc_attrib_xattrCopy(bpc_attrib_xattr *xattrSrc, bpc_attrib_file *fileDest)
}
value = (uchar*)malloc(xattrSrc->valueLen > 0 ? xattrSrc->valueLen : 1);
if ( !value ) {
free(key);
bpc_logErrf("bpc_attrib_xattrCopy: can't allocate %d bytes for value\n", xattrSrc->valueLen + 1);
return;
}
Expand Down

0 comments on commit 7215af4

Please sign in to comment.