turns out, free(NULL) is just fine ...
This commit is contained in:
		
							parent
							
								
									e1fa867423
								
							
						
					
					
						commit
						d637772339
					
				
					 3 changed files with 8 additions and 16 deletions
				
			
		| 
						 | 
					@ -164,8 +164,7 @@ convert( config_t *box )
 | 
				
			||||||
		if (!(d = opendir( buf ))) {
 | 
							if (!(d = opendir( buf ))) {
 | 
				
			||||||
			perror( "opendir" );
 | 
								perror( "opendir" );
 | 
				
			||||||
		  err4:
 | 
							  err4:
 | 
				
			||||||
			if (msgs)
 | 
								free( msgs );
 | 
				
			||||||
				free( msgs );
 | 
					 | 
				
			||||||
			if (db)
 | 
								if (db)
 | 
				
			||||||
				db->close( db, 0 );
 | 
									db->close( db, 0 );
 | 
				
			||||||
			goto err2;
 | 
								goto err2;
 | 
				
			||||||
| 
						 | 
					@ -252,8 +251,7 @@ convert( config_t *box )
 | 
				
			||||||
	close( fd );
 | 
						close( fd );
 | 
				
			||||||
	unlink( ilname );
 | 
						unlink( ilname );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (msgs)
 | 
						free( msgs );
 | 
				
			||||||
		free( msgs );
 | 
					 | 
				
			||||||
	free( mboxdir );
 | 
						free( mboxdir );
 | 
				
			||||||
	return;
 | 
						return;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -520,8 +520,7 @@ v_submit_imap_cmd( imap_store_t *ctx, struct imap_cmd *cmd,
 | 
				
			||||||
			printf( ">>> %d LOGIN <user> <pass>\n", cmd->tag );
 | 
								printf( ">>> %d LOGIN <user> <pass>\n", cmd->tag );
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (socket_write( &ctx->buf.sock, buf, bufl ) != bufl) {
 | 
						if (socket_write( &ctx->buf.sock, buf, bufl ) != bufl) {
 | 
				
			||||||
		if (cmd->param.data)
 | 
							free( cmd->param.data );
 | 
				
			||||||
			free( cmd->param.data );
 | 
					 | 
				
			||||||
		free( cmd->cmd );
 | 
							free( cmd->cmd );
 | 
				
			||||||
		free( cmd );
 | 
							free( cmd );
 | 
				
			||||||
		return NULL;
 | 
							return NULL;
 | 
				
			||||||
| 
						 | 
					@ -1115,8 +1114,7 @@ get_cmd_result( imap_store_t *ctx, struct imap_cmd *tcmd )
 | 
				
			||||||
		  normal:
 | 
							  normal:
 | 
				
			||||||
			if (cmdp->param.done)
 | 
								if (cmdp->param.done)
 | 
				
			||||||
				cmdp->param.done( ctx, cmdp, resp );
 | 
									cmdp->param.done( ctx, cmdp, resp );
 | 
				
			||||||
			if (cmdp->param.data)
 | 
								free( cmdp->param.data );
 | 
				
			||||||
				free( cmdp->param.data );
 | 
					 | 
				
			||||||
			free( cmdp->cmd );
 | 
								free( cmdp->cmd );
 | 
				
			||||||
			free( cmdp );
 | 
								free( cmdp );
 | 
				
			||||||
			if (!tcmd || tcmd == cmdp)
 | 
								if (!tcmd || tcmd == cmdp)
 | 
				
			||||||
| 
						 | 
					@ -1590,8 +1588,7 @@ imap_select( store_t *gctx, int minuid, int maxuid, int *excs, int nexcs,
 | 
				
			||||||
	ret = DRV_OK;
 | 
						ret = DRV_OK;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  bail:
 | 
					  bail:
 | 
				
			||||||
	if (excs)
 | 
						free( excs );
 | 
				
			||||||
		free( excs );
 | 
					 | 
				
			||||||
	return cb( ret, aux );
 | 
						return cb( ret, aux );
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -133,10 +133,8 @@ maildir_cleanup( store_t *gctx )
 | 
				
			||||||
	if (ctx->db)
 | 
						if (ctx->db)
 | 
				
			||||||
		ctx->db->close( ctx->db, 0 );
 | 
							ctx->db->close( ctx->db, 0 );
 | 
				
			||||||
#endif /* USE_DB */
 | 
					#endif /* USE_DB */
 | 
				
			||||||
	if (gctx->path)
 | 
						free( gctx->path );
 | 
				
			||||||
		free( gctx->path );
 | 
						free( ctx->excs );
 | 
				
			||||||
	if (ctx->excs)
 | 
					 | 
				
			||||||
		free( ctx->excs );
 | 
					 | 
				
			||||||
	if (ctx->uvfd >= 0)
 | 
						if (ctx->uvfd >= 0)
 | 
				
			||||||
		close( ctx->uvfd );
 | 
							close( ctx->uvfd );
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -214,8 +212,7 @@ maildir_free_scan( msglist_t *msglist )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (msglist->ents) {
 | 
						if (msglist->ents) {
 | 
				
			||||||
		for (i = 0; i < msglist->nents; i++)
 | 
							for (i = 0; i < msglist->nents; i++)
 | 
				
			||||||
			if (msglist->ents[i].base)
 | 
								free( msglist->ents[i].base );
 | 
				
			||||||
				free( msglist->ents[i].base );
 | 
					 | 
				
			||||||
		free( msglist->ents );
 | 
							free( msglist->ents );
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue