script: Free the correct pattern after failure.

The error path attempted to free the resolved pattern which it had just
discovered was NULL and not the locally allocated pattern...
This commit is contained in:
Chris Wilson 2010-01-18 17:14:24 +00:00
parent bc2d0ad114
commit 2b312806f1

View file

@ -1894,7 +1894,7 @@ _ft_create_for_pattern (csi_t *ctx,
/* prior to 1.9, you needed to pass a resolved pattern */
resolved = FcFontMatch (NULL, pattern, NULL);
if (_csi_unlikely (resolved == NULL)) {
FcPatternDestroy (resolved);
FcPatternDestroy (pattern);
return _csi_error (CSI_STATUS_NO_MEMORY);
}
}