From ea229b9db1647e167f6c851154a102f1b6fc3fd6 Mon Sep 17 00:00:00 2001 From: Amir Shehata Date: Tue, 28 Jul 2015 13:19:40 -0700 Subject: [PATCH] LU-6542 lnet: handle cYAML out of memory error in cYAML_build_error() there is a potential on run out of memory scenario, that it is ignored and no error is built. In this case print out a properly formated YAML error message indicating fatal error Signed-off-by: Amir Shehata Change-Id: Id9159044acafb38bd022f421a997fa2d2f1841e8 Reviewed-on: http://review.whamcloud.com/15778 Tested-by: Jenkins Reviewed-by: John L. Hammond Reviewed-by: James Simmons Tested-by: Maloo Reviewed-by: Oleg Drokin --- lnet/utils/cyaml/cyaml.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lnet/utils/cyaml/cyaml.c b/lnet/utils/cyaml/cyaml.c index 31283d8..6a12f8fb 100644 --- a/lnet/utils/cyaml/cyaml.c +++ b/lnet/utils/cyaml/cyaml.c @@ -1088,8 +1088,10 @@ void cYAML_build_error(int rc, int seq_no, char *cmd, return; failed: + /* Only reason we get here is if we run out of memory */ cYAML_free_tree(r); r = NULL; + fprintf(stderr, "error:\n\tfatal: out of memory\n"); } struct cYAML *cYAML_build_tree(char *yaml_file, -- 1.8.3.1