static inline void free_context(shout_context_t * context)
{
+ int ret;
+
if (context) {
context->err++;
int len;
while ((len = lame_encode_flush(context->gfp, mp3buffer, sizeof(mp3buffer))) > 0) {
- fwrite(mp3buffer, 1, len, context->fp);
+ ret = fwrite(mp3buffer, 1, len, context->fp);
+ if (ret < 0) {
+ break;
+ }
}
lame_mp3_tags_fid(context->gfp, context->fp);
}
if (rlen) {
- if (fwrite(mp3buf, 1, rlen, context->fp) < 0) {
+ int ret = fwrite(mp3buf, 1, rlen, context->fp);
+ if (ret < 0) {
return SWITCH_STATUS_FALSE;
}
}