From: Jim Meyering Date: Tue, 23 Jun 2009 13:44:08 +0200 Subject: [Cluster-devel] [PATCH cluster 3/5] dlm_controld: add comments: mark memory problems In-Reply-To: <1245757450-13840-1-git-send-email-jim@meyering.net> References: <1245757450-13840-1-git-send-email-jim@meyering.net> Message-ID: <1245757450-13840-4-git-send-email-jim@meyering.net> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit From: Jim Meyering * group/dlm_controld/pacemaker.c (process_cluster): Mark additional memory problems. --- group/dlm_controld/pacemaker.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/group/dlm_controld/pacemaker.c b/group/dlm_controld/pacemaker.c index b9b38d0..b06e73d 100644 --- a/group/dlm_controld/pacemaker.c +++ b/group/dlm_controld/pacemaker.c @@ -191,6 +191,7 @@ void process_cluster(int ci) log_debug("Decompressing message data"); uncompressed = malloc(new_size); + // FIXME: handle malloc failure memset(uncompressed, 0, new_size); rc = BZ2_bzBuffToBuffDecompress( @@ -212,6 +213,7 @@ void process_cluster(int ci) } else if(safe_str_eq("identify", data)) { int pid = getpid(); char *pid_s = crm_itoa(pid); + // FIXME: can crm_itoa fail? if so, does it return NULL? send_ais_text(0, pid_s, TRUE, NULL, crm_msg_ais); crm_free(pid_s); goto done; -- 1.6.3.3.420.gd4b46