/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2005 The OpenLDAP Foundation.
+ * Copyright 1998-2006 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
OidMacro **rom)
{
char *oid;
- OidMacro *om;
+ OidMacro *om = NULL;
struct berval bv;
if (argc != 3) {
fprintf( stderr, "%s: line %d: too many arguments\n",
fname, lineno );
usage: fprintf( stderr, "\tObjectIdentifier <name> <oid>\n");
+ if (om) SLAP_FREE( om );
return 1;
}
"%s: line %d: "
"ObjectIdentifier \"%s\" previously defined \"%s\"",
fname, lineno, argv[1], oid );
+ SLAP_FREE( oid );
return 1;
}
- om = (OidMacro *) SLAP_MALLOC( sizeof(OidMacro) );
+ om = (OidMacro *) SLAP_CALLOC( sizeof(OidMacro), 1 );
if( om == NULL ) {
- Debug( LDAP_DEBUG_ANY, "parse_oidm: SLAP_MALLOC failed", 0, 0, 0 );
+ Debug( LDAP_DEBUG_ANY, "parse_oidm: SLAP_CALLOC failed", 0, 0, 0 );
return 1;
}