From 1d48f91e3d6c54c9b2ed2f371e5b01f87268e690 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Tue, 17 Nov 2009 20:59:39 +0100 Subject: [PATCH 1/2] add missing break; in switch statement The 2nd missing break was harmless since it fell through the default: case which has a break, but it makes things more robust if we were ever to add new cases to this switch. The 1st missing break; was causing warnings in valgrind since we ended up calling strdup on a memory zone not containing a \0 character. --- src/plist.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/src/plist.c b/src/plist.c index eac7cc0..ed83e3c 100644 --- a/src/plist.c +++ b/src/plist.c @@ -182,9 +182,11 @@ static void plist_copy_node(GNode * node, gpointer parent_node_ptr) case PLIST_DATA: newdata->buff = (uint8_t *) malloc(data->length); memcpy(newdata->buff, data->buff, data->length); + break; case PLIST_KEY: case PLIST_STRING: newdata->strval = strdup((char *) data->strval); + break; default: break; } -- 1.6.5.2