From: Michael Schroeder Date: Mon, 10 Sep 2012 16:23:13 +0000 (+0200) Subject: - fix error handling in solv_xfopen_buf X-Git-Tag: BASE-SuSE-Code-12_3-Branch~235 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d1b3a51b15d7d917af4b51fbb2f8de56dbf4254c;p=thirdparty%2Flibsolv.git - fix error handling in solv_xfopen_buf --- diff --git a/ext/solv_xfopen.c b/ext/solv_xfopen.c index 4de122a9..429086ae 100644 --- a/ext/solv_xfopen.c +++ b/ext/solv_xfopen.c @@ -441,8 +441,8 @@ solv_xfopen_buf(const char *fn, char **bufp, size_t *buflp, const char *mode) bc->freemem = *bufp; if (!fp) { - *bc->bufp = solv_free(*bc->bufp); - *bc->buflp = 0; + if (*mode == 'w') + *bc->bufp = solv_free(*bc->bufp); cookie_bufclose(bc); } return fp;