Re: [PATCH] core.5: fix memory leak in example

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/02/2014 12:02 PM, Rahul Bedarkar wrote:
> close opened file at the end

Thanks, Rahul. Applied.

Cheers,

Michael




> Signed-off-by: Rahul Bedarkar <rahulbedarkar89@xxxxxxxxx>
> ---
>  man5/core.5 | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/man5/core.5 b/man5/core.5
> index 074add6..f2c3e36 100644
> --- a/man5/core.5
> +++ b/man5/core.5
> @@ -422,6 +422,7 @@ main(int argc, char *argv[])
>          tot += nread;
>      fprintf(fp, "Total bytes in core dump: %d\\n", tot);
>  
> +    fclose(fp);
>      exit(EXIT_SUCCESS);
>  }
>  .fi
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux