From bd3d69d1ae86f546d82a432365a391e59714195a Mon Sep 17 00:00:00 2001 From: QC Date: Sat, 1 Feb 2014 23:07:03 +0100 Subject: [PATCH] Replace malloc by allocate --- source/mark-dialog.c | 4 ++-- source/simpleswitcher.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/mark-dialog.c b/source/mark-dialog.c index 7751488d..e87c27ff 100644 --- a/source/mark-dialog.c +++ b/source/mark-dialog.c @@ -55,7 +55,7 @@ static char * escape_name( const char *mark, ssize_t *length ) { // Escape the mark. // Max length is twice the old size + trailing \0. - char *escaped_mark = malloc( sizeof( char )*( strlen( mark )*2+1 ) ); + char *escaped_mark = allocate ( sizeof( char )*( strlen( mark )*2+1 ) ); ssize_t lm = strlen( mark ); *length = 0; @@ -185,7 +185,7 @@ static char ** get_mark ( ) t = recv( s, &head, sizeof( head ),0 ); if ( t == sizeof( head ) ) { - char *result = malloc( sizeof( char )*( head.size+1 ) ); + char *result = allocate ( sizeof( char )*( head.size+1 ) ); ssize_t index = 0; t = 0; diff --git a/source/simpleswitcher.c b/source/simpleswitcher.c index c560381f..1a9885fa 100644 --- a/source/simpleswitcher.c +++ b/source/simpleswitcher.c @@ -1480,7 +1480,7 @@ int main( int argc, char *argv[] ) if ( XrmGetResource ( xDB, name, class, &xrmType, &xrmValue ) ) { if ( xrmOptions[i].type == xrm_String ) { - *xrmOptions[i].str = ( char * ) malloc ( xrmValue.size * sizeof ( char ) ); + *xrmOptions[i].str = ( char * ) allocate ( xrmValue.size * sizeof ( char ) ); strncpy ( *xrmOptions[i].str, xrmValue.addr, xrmValue.size ); } else if ( xrmOptions[i].type == xrm_Number ) { *xrmOptions[i].num = strtol ( xrmValue.addr, NULL, 10 );